SERVER SIDE PROGRAMMING USING

SERVLETS AND JAVASERVER PAGES

 

General:

 

This course provides programmers having an understanding of the classes and packages defined in the Java Standard Edition (JSE) with the ability to undertake server side web development using Servlets and JavaServer Pages as defined by the Java Enterprise Edition (JEE) standard. The course focuses on the packages, classes, interfaces, and methods necessary to create and use Servlets, in addition to the constructs, directives, and action tags necessary to create and use JavaServer Pages (JSP).

 

The information presented in the course can be applied to any Application Server environment including, but not limited to, WebSphere and JBOSS. However, whenever it is necessary to use a specific servlet container to demonstrate issues related to Servlet or JSP deployment, the course uses Apache Tomcat.

 

 

Objectives:

 

Upon successful completion of this course, the student will be able to:

 

         Create, deploy and execute Servlets and JSPs to implement web applications

         Identify and use classes and interfaces in the javax.servlet package

         Identify and use classes and interfaces in the javax.servlet.http package

         Create an use sessions to share attributes between multiple client requests

         Forward and redirect requests to other servlets or JSPs

         Create and deploy servlet filters

         Use JSP constructs to implement a web page

         Use JSP directives and action tags to implement a web page

         Create a web application using MVC design pattern

 

 

Audience:

 

Technical Users, Applications Programmers, and Systems Programmers.

 

 

Prerequisites:

 

Introduction to Java and Intermediate Java courses or equivalent experience with using the Java Standard Edition (JSE) for creating applets and stand-alone programs. Familiarity with basic HTML. Some exposure to XML would also be helpful.

 

 

Duration:

 

Five (5) days. The course includes both classroom lecture and hands-on lab sessions. Depending on the experience level of the students, if the amount of required Java Review is minimal, it may be possible to teach the course in four (4) days.


SERVER SIDE PROGRAMMING USING

SERVLETS AND JAVASERVER PAGES

COURSE OUTLINE

 

 


I.         BASIC JAVA REVIEW

 

 

II.       INTRODUCTION TO SERVLETS

 

A.      Definition of Servlet

B.      Servlet vs. Applet and CGI

C.      Servlet Architecture

D.      HTTP Protocol

E.      JEE Web Application Structure

F.      Servlet Creation

G.     Servlet Deployment

H.      Servlet Execution

 

 

III.      SERVLET CLASSES AND INTERFACES

 

A.      Servlet Packages

1.       javax.servlet

2.       javax.servlet.http

B.      Servlet Interface

1.       Life Cycle Methods (init, service, destroy)

2.       Additional Methods

C.      GenericServlet Class

1.       Servlet Methods

2.       ServletConfig Methods

D.      Handling servlet exceptions

1.       ServletException class

2.       Rethrowing exception root cause

E.      Request and Response

1.       ServletRequest Methods

2.       ServletResponse Methods

F.      Web Application Context

1.       ServletContext Methods

2.       Getting and Setting Attributes

3.       Initialization Parameters

 

 

IV.    HTTP SERVLETS

 

A.      HTTP Requests and Responses

B.      HttpServlet Class

1.       doGet Method

2.       doPost Method


C.      HttpServletRequest Interface

1.       Retrieving Header Information

2.       Retrieving Main Line Request Information

D.      HttpServletResponse Interface

1.       Setting Headers

2.       Setting Status

E.      Uploading files

F.      Validating FORM Parameters

 

 

V.      DATA SHARING AND TRANSFER OF CONTROL

 

A.      Data Sharing

1.       Request Scope

2.       Session Scope

3.       Context Scope

B.      Session Tracking

1.       HttpSession Interface

2.       Creating a Session

3.       Setting Session Attributes

4.       Retrieving Session Attributes

C.      Cookies

1.       Cookie Class

2.       Creating Cookies

3.       Sending Cookies

4.       Retrieving Cookies

5.       Session Cookies vs. Persistent Cookies

D.      Servlet Chaining

1.       RequestDispatcher Interface

2.       Forwarding Requests

3.       Including Responses

E.      Forwarding vs. Redirecting Requests

1.       Forward Request Without Involving Browser

2.       Redirect Request Through Browser via SendRedirect

F.      Servlet Filters

1.       Filter Definition and Benefits

2.       Filter Chaining

3.       Filter Related Interfaces

4.       Filter Deployment


VI.    INTRODUCTION TO JAVASERVER PAGES

 

A.      What Are JavaServer Pages

B.      JSP Execution Steps

C.      JSP Syntax

1.       Quoting

2.       Enclosing Characters

3.       Filename Extension

4.       Alternative XML Syntax

D.      JSP Deployment and Execution

E.      JSP Constructs

1.       Comments

a.       HTML (<!-- -->)

b.       JSP (<%-- --%>)

2.       Expressions (<%= %>)

3.       Predefined Variables

4.       Declarations (<%! %>)

5.       Scriptlets (<% %>)

 


VII.   JSP DIRECTIVES AND ACTION TAGS

 

A.      JSP Directive Syntax

B.      Directive Types and Attributes

1.       page Directive

2.       include Directive

C.      JSP Action Tag Syntax

D.      Action Tags

1.       jsp:include

2.       jsp:parm

3.       jsp:plugin

4.       jsp:parms

5.       jsp:fallback

E.      What is a JavaBean

F.      JavaBean Related Action Tags

1.       jsp:useBean

2.       jsp:getProperty

3.       jsp:setProperty

G.     Web Application Development Models

1.       Model 1 Architecture

2.       Model 2 Architecture

3.       Using Model, View, Controller (MVC)