Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
1.4 The Advantages of JSP
11
extensive API for networking, database access, distributed objects, and the like,
whereas PHP requires learning an entirely new language.
Versus Pure Servlets
JSP doesn't provide any capabilities that couldn't in principle be accom
plished with a servlet. In fact, JSP documents are automatically translated
into servlets behind the scenes. But it is more convenient to write (and to
modify!) regular HTML than to have a zillion
println
statements that gen
erate the HTML. Plus, by separating the presentation from the content, you
can put different people on different tasks: your Web page design experts can
build the HTML using familiar tools and leave places for your servlet pro
grammers to insert the dynamic content.
Versus Server Side Includes (SSI)
SSI is a widely supported technology for inserting externally defined pieces
into a static Web page. JSP is better because you have a richer set of tools for
building that external piece and have more options regarding the stage of the
HTTP response at which the piece actually gets inserted. Besides, SSI is
really intended only for simple inclusions, not for real programs that use
form data, make database connections, and the like.
Versus JavaScript
JavaScript, which is completely distinct from the Java programming language,
is normally used to generate HTML dynamically on the client, building parts
of the Web page as the browser loads the document. This is a useful capabil
ity but only handles situations where the dynamic information is based on the
client's environment. With the exception of cookies, the HTTP request data
is not available to client side JavaScript routines. And, since JavaScript lacks
routines for network programming, JavaScript code on the client cannot
access server side resources like databases, catalogs, pricing information, and
the like. JavaScript can also be used on the server, most notably on Netscape
servers and as a scripting language for IIS. Java is far more powerful, flexible,
reliable, and portable.
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.
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