1 / 4

JSP -exercises-

JSP -exercises-. Alessandro Marchetto Fondazione Bruno Kessler-IRST, Centro per la Ricerca Scientifica e Tecnologica. 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:

dorie
Download Presentation

JSP -exercises-

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. Servlet, JSP and Form – Name application • 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: namesurname” • 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: namesurname” • 4.JavaBean • - it defines a string and two methods to set/get the string

  4. Java Bean -1 • 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

More Related