iTP Secure WebServer System Administrator's Guide (iTPWebSvr 6.0+)
Using NonStop Servlets for JavaServer Pages
(NSJSP)
iTP Secure WebServer System Administrator’s Guide—523346-002
9-40
How To Create a Form
The web container sends the request object to the server-side component specified in
the JSP file. This could be a servlet, some internal Java code, or some external Java
Bean code. That component handles the request, usually retrieving data from a
database and passes a response object back to the web container. The web container
passes the response object to the JSP page, where its data is formatted according the
page's HTML design. The web container and iTP Secure WebServer then send the
revised JSP page back to the client, where the user can view the results in the web
browser.
How To Create a Form
To write the HTML form in a JSP source file, you can use JSP tags to pass data
between the form and the server-side object. These are the basic steps:
•
Write a JSP source file, creating an HTML form and giving each form element a
name.
•
Write the bean in a java source file, defining properties, GET, and SET methods that
correspond to the form element names.
•
Add a <jsp:usebean> tag in the JSP source code to create or locate an instance
of the bean.
•
Add a <jsp:setProperty> tag in the JSP source code to set properties in the
bean from the HTML form. The bean needs a matching SET method.
•
Add a <jsp:getProperty> tag to retrieve the data from the bean. The bean
needs a matching GET method.
Figure 9-6. Requests and Responses in a JSP Application.
VST906.vsd
Client Browser iTP WebServer
JSP Page
Component