Servlets and JSPs Programming with JSTL (EJWS-835)

Request a Quote for this class

About this Course

This course is designed to provide students with the knowledge and skills to become productive using Servlets and JavaServer Pages (JSPs), the foundation of Web application development in J2EE. Students will be taught using Live Web-based training and comprehensive practical exercises designed to explain the fundamentals of J2EE Web application development. Completely tool-agnostic, students will rapidly negotiate the learning curve and be ready to write, package and deploy Web applications to a production WebSphere environment.

Audience Profile

  • Application Developers
  • Java Programmers
  • Client Server Programmers
  • Software Developers

At Course Completion

Upon completion of the course, students will be able to:

  • Describe the fundamental principles of the J2EE Web Container in WebSphere
  • Exercise the Servlet 2.4 API to produce code to meet any web development requirement
  • Manage sessions across an HTTP connection
  • Apply the fundamentals of JavaServer Pages
  • Build and apply custom JSP tags

Prerequisites

Understand the fundamentals of Object-Orientation

  • Understand the language fundamentals and core APIs of the Java 2 Standard Edition (J2SE)

Course Outline

1. Introduction to J2EE

  • J2EE definition
  • J2EE history
  • Applications on the web
  • Creating an application
  • Creating source code
  • application.xml
  • web.xml
  • Application deployment
  • XML in J2EE

2. Introduction to Programming Servlets

  • Servlets and the web container
  • init()
  • service()
  • destroy()
  • HttpServlet
  • doGet()
  • doPost()
  • Additional handling methods
  • Additional methods
  • Servlets and performance
  • Servlets and threading
  • Consequences of threading
  • Configuring a servlet for deployment
  • Servlet entry in web.xml
  • URL mappings

3. ServletContext and SrvletConfig

  • ServletContext interface
  • Initialization parameters
  • Scope of a ServletContext interface
  • Context attributes
  • Multiple hosts and servlet contexts
  • ServletConfig

4. Request and Response Objects

  • The request object
  • getParameter
  • Other request object methods
  • Request path elements
  • Path translation methods
  • Attributes
  • Cookies
  • Lifetime of the request object
  • The response object
  • Buffering
  • Headers
  • Convenience methods
  • Lifetime of the response object

5. Sessions

  • Definition
  • How sessions work
  • Cookies
    • Introduction
    • Scope
  • Cookies and sessions
  • URL rewriting
  • Using sessions with J2EE
  • Using getSession
  • Session Timeout
    • Configuration
    • Details
  • Binding attributes into a session
  • Last accessed times
  • Sessions and threading
  • Threads and clusters

6. Dispatching Requests

  • Obtaining a request dispatcher
  • Query strings in request dispatcher paths
  • Using a request dispatcher
  • The include method
  • Included request parameters
  • The forward method
  • Query string
  • Forwarded request parameters

7. Listeners

  • Definition
  • ServletContext event handling
  • Working with the interfaces
  • ServletContext creation/destruction
  • ServletContext event handling
  • ServletContext listeners
  • Attribute
  • XML for context attribute listeners
  • Handling session events
  • Session life-cycle event handling
  • HttpSessionEvent
  • HttpSessionBindingListener
  • HttpSessionBindingEvent
  • HttpSessionActivationListener
  • Session attribute event handling
  • Session attribute interfaces

8. Wrappers

  • History
  • Introduction

9. Filters

  • Definition
  • Filtering components
  • Basic procedure
  • Filter life-cycle
  • Wrapping requests and responses
  • Filter environment
  • Filter mapping in web.xml
  • Filters and the RequestDispatcher

10. Introduction to JSP

  • Introduction
  • Adding Java code to a JSP
  • JSP implicit objects
  • Using request and out
  • Using the session object
  • Other elements of a JSP
  • Declarations
  • Directives
  • JSP expression language
  • Standard action tags
  • Custom action tags

11. JSP Declarations and Directives

  • Declarations
  • Invoking declarations
  • Attributes and methods
  • Directives
  • Directive syntax
  • The include directive
  • The page directive
  • page directive attributes
  • page attributes
  • The taglib directive

12. Using Beans - Accessing JavaBeans Via Tags

  • Introduction
  • Specifying a bean to use
  • useBean : id and class
  • useBean : scope, type and beanName
  • getProperty
  • useBean with child tags
  • setProperty
  • setProperty : value
  • setProperty : property and param
  • Mapping properties to a new bean
  • Mapping parameters to attributes
  • Data conversions when mapping parameters

13. Error Handling

  • Introduction
  • Run-time errors
  • Using error pages
  • Using JSPs as error pages

14. JSP Expressive Language (EL)

  • Introduction
  • EL Values
    • pageContext
    • The scope expression
    • pageScope
    • requestScope
    • sessionScope
    • The paramExpression
  • Working with maps
  • Working with lists
  • EL operations
    • Arithmetic
    • Unary
    • Comparative
    • Choice expressions

15. Tag Files

  • Introduction
  • Including tag files
  • Passing attributes to a tag file
  • The attribute directive
  • The doBody tag
  • Returning data
  • Storing tag files in a JAR
  • The tag file TLD
  • Using the JAR

16. JSP Standard Tag Library

  • Installing JSTL
  • Syntax
  • Online documentation
  • The core library
    • out tag
    • if tag
    • choose, when and otherwise
    • forEach
    • forTokens
    • import
    • import and param
    • import and scope
    • url
    • url and scope
    • set and remove
  • Setting a variable
  • Working with JavaBeans
  • catch
  • The functions library
    • contains
    • join and split
    • split
    • join
    • escapeXml
  • The xml library
    • Loading and parsing a file
    • Using XPath
    • XPath functions
    • out tag
    • foreach tag
    • transform tag
    • param tag
    • the if tag
    • the choose tag
    • set tag
  • The fmt library
    • the locale and bundle tags
    • Creating a bundle in a Properties
    • files
    • setLocale tag
    • setBundle tag
    • formatMessage tag
  • Using Java classes as bundles
  • Dates and numbers
  • The sql library

17. Custom Tags

  • Introduction
  • Tag handlers prior to v 2.0
    • doStart tag
    • JSP 2.0
    • Creating attributes
  • Processing body data
  • Creating the TLD file
  • Creating the TLD file – adding tags
  • The body-content tag
  • A complete TLD file – v 2.0
  • A complete TLD file – v 1.2
  • Discovering TLD files
  • Using TLD files
  • Java Class