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-39
An Example of JSP Code
An Example of JSP Code
This is an example use of templating, a common technique used in web page
development, that uses the services of more than one servlet. We show the template
coded as JSP using the include directive to reference some HTML in another file.
The JSP is:
<%-- Filename: "TemplateDemo.jsp" --%>
<HTML>
<BODY>
<CENTER> Welcome To My WebSite</CENTER>
<BR>
<P> The time is <% new java.util.Date().toString() %> </P>
<%@ include file = "Body.html" %>
</BODY>
</HTML>
The HTML file called Body is:
<BR>
<H1>
This is text that will be included in the body of the HTML in
the JSP file
</H1>
<BR>
How To Handle an HTML Form
Probably the most basic part of a web application is an HTML form in which a user
enters some information. The information might be a customer's name and address, a
word or phrase entered for a search engine, or selection from an online catalog.
The information the user enters in the form is stored in the request object, which is sent
from the client to the JSP container
Figure 9-6, Requests and Responses in a JSP Application.
represents a generic data
flow between the client and the application in the web container.