Presentation is loading. Please wait.

Presentation is loading. Please wait.

JSP -exercises- Alessandro Marchetto Fondazione Bruno Kessler-IRST, Centro per la Ricerca Scientifica e Tecnologica.

Similar presentations


Presentation on theme: "JSP -exercises- Alessandro Marchetto Fondazione Bruno Kessler-IRST, Centro per la Ricerca Scientifica e Tecnologica."— Presentation transcript:

1 JSP -exercises- Alessandro Marchetto Fondazione Bruno Kessler-IRST, Centro per la Ricerca Scientifica e Tecnologica

2 JSP demo Write a JSP application composed of: 1.An HTML page with a form that requests a string to the user (e.g., the name of the user) 2.A JSP page: - it reads the string sent by the client html - it writes the string in a dynamically generated HTML page (that contains, e.g., Welcome + string) - it writes in the generated HTML page also the current date (using java.util.Date)

3 Write a servlet and jsp based application as follows: 1.Client - an HTML page with two Forms that contain two text fields (name and surname) and a submit button (that uses the GET method) - the first Form sends its data to a servlet - the other sends its data to a Jsp page 2.A Servlet - it reads name and surname sent by the client (via GET) - and it writes a string such as Welcome: name surname 3.A JSP - it reads name and surname sent by the client (via GET) - it stores name and surname in a JavaBean - it reads the data stored in the JavaBean - it writes the stored data in the output using a string such as Welcome: name surname 4.JavaBean - it defines a string and two methods to set/get the string Servlet, JSP and Form – Name application

4 Write a Jsp that uses a JavaBean as follows: JavaBean - it defines a string and two methods to get value of the string and to set it (via parameter) JSP - it uses the JavaBean - it uses the jsp:setProperty in order to set the string-field of the Bean with the value Hello Client! - it uses the jsp:getProperty in order to get the value of the string-field and write it on the output Java Bean -1


Download ppt "JSP -exercises- Alessandro Marchetto Fondazione Bruno Kessler-IRST, Centro per la Ricerca Scientifica e Tecnologica."

Similar presentations


Ads by Google