Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
Chapter
avaServer Pages (JSP) technology enables you to mix regular, static
HTML with dynamically generated content from servlets. You simply
J
write the regular HTML in the normal manner, using familiar
Web page building tools. You then enclose the code for the dynamic
parts in special tags, most of which start with
<%
and end with
%>
. For
example, here is a section of a JSP page that results in Thanks for ordering
Core Web Programming for a URL of
http://host/OrderConfirma
tion.jsp?title=Core+Web+Programming
:
Thanks for ordering <%= request.getParameter("title") %>
Separating the static HTML from the dynamic content provides a number
of benefits over servlets alone, and the approach used in JavaServer Pages
offers several advantages over competing technologies such as ASP, PHP, or
ColdFusion. Section 1.4 (The Advantages of JSP) gives some details on these
advantages, but they basically boil down to two facts: that JSP is widely sup
ported and thus doesn't lock you into a particular operating system or Web
server and that JSP gives you full access to servlet and Java technology for the
dynamic part, rather than requiring you to use an unfamiliar and weaker spe
cial purpose language.
The process of making JavaServer Pages accessible on the Web is much
simpler than that for servlets. Assuming you have a Web server that supports
JSP, you give your file a
.jsp
extension and simply install it in any place you
231
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved