Servlets and JavaServer Pages
A
Part of the Java: Under the Hood™
Series
Audience: Programmers who
have a good working knowledge of the Java programming language,
as well as a basic understanding of Web technologies and HTML.
Course Length: 4 days
Servlets and JavaServer Pages
covers the details of developing Web applications that use the server-side
capabilities of Java Servlets and JavaServer Pages. Students will
learn the architecture of Servlets and JSP, including issues like
performance, multithreading, and design guidelines. The labs for
the course develop an online store complete with a shopping cart
and real data in a database using the Model-View-Controller design.
Course
Outline (download
pdf version)
Servlets
- Overview of Servlets: Programs
that run in a Web server.
- Server-side Development: Options
for creating Web applications.
- Advantages of Servlets: Powerful,
portable and secure.
- The Servlet API: The javax.servlet
and javax.servlet.http packages.
- HTTP: The Hypertext Transfer
Protocol.
- Requests: The HTTP Request
header.
- Responses: The HTTP Response
header.
- HTML Basics: A quick introduction
to HTML and its syntax.
- HTTP Servlets: The HttpServlet
class.
- The "Hello, World"
Servlet: A simple HTTP servlet handling a GET request.
- The Lifecycle of a Servlet:
The servlet container.
- A Servlet Counter: A demonstration
of the lifecycle of a servlet.
- HttpServletRequest: Encapsulating
the HTTP request header of a client request.
- HttpServletResponse: Encapsulating
the HTTP respone to a client.
- Parameters: Obtaining data
from the client request.
- The Request Dispatcher: Including
servlets and forwarding requests to other servlets.
- Scope: Understanding the various
scopes an object can have within a servlet container.
- Request Scope: Objects associated
with a client request.
- Application Scope: A container-wide
object.
- Session Scope: Creating client
sessions.
- Cookies: A sweet session tracker.
- The HttpSession Interface:
Container session objects.
- URL Rewriting: Encoding a URL.
- Servlet Threading Models: The
SingleThreadModel.
- Connecting to a Database: JDBC
within a servlet.
- Server-side Includes: A servlet
embedded in an HTML page.
JavaBeans
- Overview of JavaBeans: Java
software components.
- The Bean Development Kit: The
bean specification and Sun’s beanbox.
- Properties: Adding properties
to a bean.
- Methods: A bean’s behavior.
- Events: How beans communicate
with each other.
JDBC
- Overview of JDBC: An
API for communicating with databases.
- JDBC Drivers: Understanding
the various types of drivers available for JDBC.
- Connecting to a Database:
Loading the appropriate driver and
making the connection.
- Statements: Executing
SQL statements.
- Prepared Statements:
Executing precompiled SQL statements.
- Results: Working
with result sets.
JavaServer Pages
- Server-side Development:
Comparing JSP to other technologies.
- Overview of JavaServer Pages:
Java technology for creating dynamic Web content.
- JSP Lifecycle:
Translation of JSP into servlets.
- An Introduction to Servlets:
Understanding how servlets run on a Web server.
- "Hello, JSPs":
A simple JavaServer Page.
- JavaServer Page Tags:
The various JSP tags.
- Templating:
The include directive.
- Declarations: Declaring
variables and methods.
- Expressions:
Java statements within a JSP.
- The request Object:
The request header information.
- Parameters:
Request data passed in to the JSP.
- Scriptlets:
Embedding Java code within a JSP.
- Directives:
Specifying options for the page.
- Implicit Objects:
The implicit objects of a JSP.
- JSP Actions:
The action tags of JSP.
- Overview of JavaBeans:
Java software components.
- JavaBeans in JSPs:
The useBean directive.
- Error Pages:
Handling exceptions in JSP.
- Scope:
The four scopes of JSP objects.
- Sessions:
Creating sessions within JSP.
- Request Scope:
Associating data with the request.
- Application Scope:
The implicit application object.
- Session Scope:
Creating client sessions.
- The Implicit Session Object:
Session tracking made easy.
- Beans with Session Scope
Custom Tags and JSTL
- Creating your own JSP
tags
- Writing Tag Handler classes
- The Tag Library Definition
File
- The JSP Standard Template
Library
|
|