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.
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 Outline
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.