Home About Courses Schedule Services Webinars Contact Search

Java EE Programming with Servlets and JSPs

SEE SCHEDULE

Duration: 5 Days

Method: Instructor led, Hands-on workshops

Price: $2750.00

Course Code: JA1050



Audience

Technical Users, Applications Programmers, and Systems Programmers

Description

You already know Java, but need to use it to develop and maintain web applications. The Java Standard Edition (SE) is not enough. You need the Java Enterprise Edition (EE). You need to be able to write code that runs on a Java EE server like WebSphere. You need to know about server side web development using Servlets and JavaServer Pages (JSPs) as defined by the Java Enterprise Edition (JEE) standard.

You will learn about 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. Model-View-Controller (MVC) architecture is addressed including RequestDispatcher, as well as storing session state and using filters. The information presented in the class can be applied to any Java EE Server environment. Apache Tomcat is used as the servlet container to during the course but WebSphere can also be supported by the lab exercises.

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 and javax.servlet.http packages
  • Create and use sessions to share attributes between multiple client requests
  • Forward and redirect client requests
  • Create and deploy servlet filters
  • Use JSP constructs to implement a web page
  • Use JSP directives and action tags to implement a web page
  • Use JSTL tags and the EL to better support JSP development
  • Create a web application using MVC design pattern

Prerequisites

Java training and/or experience with the Java Standard Edition (JSE) is required. Familiarity with basic HTML is helpful but not required. Some exposure to XML would also be helpful but is not required.

Topics

  1. Introduction to JavaServer Pages (JSPs)
    • Crash course on HTML
      • Commonly used tags
      • Forms and their fields
    • JSP structure and approach
    • Scriptlets and expressions
    • Methods of the request object
    • Sending a request to a JSP
      • GET vs POST
    • Imports, comments, and instance variables
    • The generated servlet
    • Fixing common JSP errors
  2. Introduction to Servlets
    • Definition of Servlet
    • Servlet-related framework classes
    • The doGet and doPost methods
    • Configuration and web.xml
    • URLs and mapping of servlet requests
    • Instance variables and thread safety
    • Solving common servlet errors
  3. Using MVC to Structure Web Applications
    • Servlet Architecture
    • Model-View-Controller (MVC) pattern
    • Request attributes - getting and setting
    • Forwarding requests
    • Redirecting responses
    • Data validation
      • Client vs server-side validation
    • JSP includes
      • Action include
      • jsp:includes
    • Configuration and web.xml
    • Working with initialization parameters
    • Implementing a custom error handler
  4. Working with Sessions and Cookies
    • Session Tracking
      • HttpSession Interface
      • Creating a Session
      • Setting Session Attributes
      • Retrieving Session Attributes
      • URL encoding vs cookies
    • Cookies
      • Cookie class
      • Creating and sending cookies
      • Viewing and deleting cookies
      • Session Cookies vs. Persistent Cookies
    • URL rewriting and hidden fields
  5. JSP Tags for Working with JavaBeans
    • What is a JavaBean
    • JavaBean Related Action Tags
      • jsp:useBean
      • jsp:getProperty
      • jsp:setProperty
  6. JSP Expression Language (EL)
    • EL Introdcution
      • Advantages and disadvantages
    • Dot operator for beans and maps
    • Specifying scope with EL
    • Using [ ] to work with arrays and lists
    • Accessing nested properties
    • Implicit EL objects
    • Other EL operators
    • Disabling EL
  7. JSP Standard Tag Library (JSTL)
    • Introduction to JSTL
    • Tag Libraries and JSTL
    • JSTL Tag Libraries
    • Making JSTL Jar files available
    • Introducing the Core Tags
      • Producing Output and Utilizing Variables
      • Looping with JSTL
      • Condition Checking - if and choose
      • Enhanced importing
      • Other tags
  8. Working with HTTP Requests and Responses
    • Introduction to HTTP requests and responses
      • Common MIME types
      • – Common HTTP request headers
      • Common HTTP status codes
      • Common HTTP response headers
    • Working with the request headers
    • Setting response headers and status codes
    • Practical skills for working with HTTP
      • Interacting with Excel
      • Controlling caching
      • Compressing a response with GZIP
      • Displaying the File Download dialog box
  9. Working with Filters
    • Introduction to Filters
      • How filters work
      • Benefits of filters
      • When to use filters
    • How to add a filter
      • Coding a filter
      • Configuring a filter
    • Servlet Filter examples
      • Request-side Filter processing
      • Response-side Filter processing
    • Other skills for working with filters
      • Wrapping a request or a response
      • Initialization parameters
  10. Custom JSP Tags (optional section)
    • Code a custom tag without a body
    • Code a custom tag with a body
    • Code a custom tag with attributes
    • Scripting variables
    • Provided classes, methods and fields
  11. Send email Using JavaMail (optional section)
    • How email works
    • Installing JavaMail API
    • Sending an email message
      • Create a mail session
      • Create a message
      • Address a message
      • Send a message
  12. Send email Using JavaMail (optional section))
    • Introduction to SSL
    • How SSL and TLS work
    • SSL authentication and digital certificates
    • Enabling SSL on the server
    • Requesting a secure connection
    • JSP using a secure connection
  13. Securing a Web Resource (optional section)
    • Introduction to authenticaton
    • Container-managed authentication
    • Types of authentication
    • Security roles and security constraints
    • Implementing a security realm
    • Allowing access to authorized users
  14. Working with Listeners (optional section)
    • ServletContextListener Interface
      • Coding a class for the listener
      • Registering the listener
      • JSP using attributes set by the listener
    • Other types of listeners
      • Summary of listener interfaces
      • Methods of the listener interfaces
      • Methods of event objects