Chapter 1.  JavaServer Pages Pocket Reference

The JavaServer Pages™ ( JSP) specification is built on top of the Java™ servlet specification and is intended to provide for better separation of the presentation (e.g., HTML markup) and business logic (e.g., database operations) parts of web applications. JSP is supported by all major web and application servers. A partial listing of JSP-compliant products is available at Sun Microsystems’ JSP web page:

http://java.sun.com/products/jsp/

A JSP page is a web page that contains both static content, such as HTML, and JSP elements for generating the parts that differ with each request, as shown in Figure 1-1. The default filename extension for a JSP page is .jsp.

Template text and JSP elements
Figure 1-1. Template text and JSP elements

Everything in the page that’s not a JSP element is called template text. Template text can be in any format, including HTML, WML, XML, and even plain text. Since HTML is by far the most common web page language in use today, most of the descriptions and examples in this text are HTML-based. You should be aware, though, that JSP has no dependency on HTML. Template text is not interpreted at all; it’s passed straight through to the browser. JSP is therefore well-suited to serve any markup language.

When a JSP page request is processed, the static template text and the dynamic content generated by the JSP elements are merged, and the result ...

Get JavaServer Pages Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.