JSP Tutorials - Herong's Tutorial Examples
∟JSP (JavaServer Pages) Overview
∟How JSP Pages Are Processed
This section describes how JSP pages are processed by the Web server. Two key steps are involved: 1) compilation of the JSP page into a Java Servlet class; 2) execution of the compiled class.
Before looking at how a JSP page is processed, let's see how a static HTML page
is processed by a Web server first:
- Step 1: The Web browser sends a HTTP request to the Web server with the path name of
the HTML page.
- Step 2: The Web server picks up the HTML page by following the specified path name.
- Step 3: The Web server puts the content of the HTML page into the HTTP response without any changes.
- Step 4: The Web server sends the HTTP response back to the Web browser.
Now look at how a JSP page is processed by a Web server:
- Step 1: The Web browser sends a HTTP request to the Web server with the path name of
the JSP page.
- Step 2: The Web server checks to see if there is a compiled version of the requested
JSP page. If yes, continue with Step 4. If no, continue with Step 3.
- Step 3. The Web server converts the JSP page to a Java Servlet source code and compiles
it into a Java bytecode (the compiled version of the JSP page).
- Step 4: The Web server executes the compiled version of the requested JSP page, and
collects the output of the execution.
- Step 5: The Web server puts the output of the execution into a HTTP response.
- Step 6: The Web server sends the HTTP response back to the Web browser.
There are two key steps involved in serving a JSP page:
- Compilation: A JSP page must be compiled into a Java Servlet class,
before it can be executed. The Web server can compile a JSP page in real-time if the page
is requested for the first time and the page is not pre-compiled.
- Execution: When a JSP page is requested, its compiled class will be executed
on the server. The server will send back the output of the execution, not the content
of the JSP page.
Table of Contents
About This Book
►JSP (JavaServer Pages) Overview
What Is JSP (JavaServer Pages)
JSP Releases and Changes
Main Features of JSP
►How JSP Pages Are Processed
Popular JSP Enabled Web Servers
Tomcat 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
Using Tomcat on CentOS Systems
Using Tomcat on macOS Systems
Connecting to SQL Server from Servlet
Developing Web Applications with Servlet
Archived Tutorials
References
Full Version in PDF/EPUB