What Is JSP (JavaServer Pages)?

This section describes what is JSP (JavaServer Pages) - A Web application technology that allows you to generate dynamic data in Web documents with embedded Java statements and other expressions in special tags.

What Is JSP (JavaServer Pages)? JSP is a technology, not a language. It allows Web page authors to generate dynamic data into a Web document with embedded Java statements and other expressions in special tags. The embedded statements and expressions will be executed by the JSP enabled Web server, not by the Web browser.

Here is the official definition of JSP from the JSP specification document: JavaServer Pages (JSP) is the Java Platform, Enterprise Edition (Java EE) technology for building applications for generating dynamic web content, such as HTML, DHTML, XHTML, and XML. JSP technology enables the easy authoring of web pages that creates dynamic content with maximum power and flexibility.

What Is a JSP Page? A JSP page is a text document that contains a mixture of two types of data:

When a JSP page is processed by a Web server, the final output document should form a complete HTML document to be delivered back to the Web browser.

Here is a simple JSP page example, hello.jsp:

<html><body>
<% out.println("Hello world!"); %>
</body></html>

As you can see, line 1 and 3 of hello.jsp are static data. Line 2 is a JSP element that represents dynamic data.

When hello.jsp is processed by the Web server, it will produce a HTML document with these lines:

<html><body>
Hello world!
</body></html>

The diagram below illustrates how static data and dynamic data get mapped into the final HTML document.
JSP Page Mapped to HTML Document

For more information on JSP, see the latest release of JSP specification, JSP 2.1, at http://jcp.org/aboutJava/communityprocess/final/jsr245/.

Last update: 2012.

Table of Contents

 About This Book

JSP (JavaServer Pages) Overview

What Is JSP (JavaServer Pages)?

 Main Features of JSP 2.1

 How JSP Pages Are Processed?

 Popular JSP Enabled Web Servers

 Tomcat 7 Installation on Windows Systems

 JSP Scripting Elements

 Java Servlet Introduction

 JSP Implicit Objects

 Syntax of JSP Pages and JSP Documents

 JSP Application Session

 Managing Cookies in JSP Pages

 JavaBean Objects and "useBean" Action Elements

 Managing HTTP Response Header Lines

 Non-ASCII Characters Support in JSP Pages

 Performance of JSP Pages

 EL (Expression Language)

 Overview of JSTL (JSP Standard Tag Libraries)

 JSTL Core Library

 JSP Custom Tags

 JSP Java Tag Interface

 Custom Tag Attributes

 Multiple Tags Working Together

 File Upload Test Application

 Outdated Tutorials

 References

 PDF Printing Version