Ajax Training: Ajax for Java Developers
EJB Training: Introduction to Enterprise Java Beans
Groovy for Java Developers
Hibernate Training
Intermediate Java Training
Introduction to Java Programming Training
Introduction to XML Training
Jakarta Struts Training
Java Development for Secure Systems
Java EE 5 (JEE - including EJB3)
Java Programming with Eclipse
JavaServer Faces (JSF) : Using JSF to Build J2EE Web Apps on the JBoss Application Server
JavaServer Faces Training: Introduction to JSF Training
JavaServer Pages Training: Introduction to JSP and Servlets Training
JBoss Training: Administering the JBoss 4.x Application Server
JBoss Training: Administering the JBoss® 5.X Application Server
JBoss Training: Enterprise JavaBeans (EJB 3) on the JBoss Application Server
JBoss Training: Enterprise JavaBeans 3.0 (EJB3) and the Java Persistence API (JPA) on the JBoss Application Server
JBoss Training: Java EE with Servlets JSP & JDBC on JBoss AS
JBoss Training: Servlets/JSP on the JBoss Application Server
JBoss Training: SOA and Java Web Services (JAX-WS) on the JBoss Application Server
Patterns In Frameworks Workshop
Software Design Training: Effective Software Development Training Boot Camp
Spring Framework Training (Spring 3)
Test Driven Development (TDD) for Java
The JSP Standard Tag Library (JSTL)
Web Development Using Grails Training
Web Services Training: Developing Java Web Services
XML Programming Using Java
    

JavaServer Pages Training: Introduction to JSP and Servlets Training

This course can be taught in WSAD, RAD, Eclipse, NetBeans, JBoss and other IDE's.
  Course #:  NT109
  Duration:  5 days

JSP Training Overview

nTier's Introduction to JSP and Servlets training course develops skills in JavaServer Pages, or JSP, which is the standard means of authoring dynamic content for Web applications under the Java Enterprise platform. It treats JSP 2.0, including older features such as scriptlets but focusing on newer features and techniques, including JSP expressions and the JSTL.  This course develops the important concept of the separation of programmatic and declarative development: use of configuration and context information in lieu of hard-coded values, resource locations, etc., to make the Web application as portable and easy to administer as possible. The course introduces JavaBeans as a standard for business and data objects that can be shared among servlets and JSPs, and develops techniques for sharing such objects at session scope or by request forwarding. Finally, students learn how to implement filters to adapt existing servlets by pre- and post-processing the request and response.

At the end of the course, students will be well prepared to author JSPs for small- or large-scale Web applications, either "by hand" (they use only a text editor in class) or using an authoring tool.

The first module begins with an introduction of Web applications in general, shows how Java servlets and JSPs establish a framework for writing Web applications, and then covers JSP 2.0 features in detail, from scripting elements to use of dedicated JavaBeans to JSP expressions, and quick introductions of JSTL and custom tag development. By the end of the module students will be able to create their own JSP applications, including interactive applications using HTML forms and pages that perform fairly complex processing using scripts and or actions. Although scripting is covered, the scriptless authoring style encouraged by the JSP 2.0 specification is emphasized, and students will be well equipped to develop concise and effective JSP applications. The second module covers the JSTL, or JSP Standard Tag Library, actually a set of four custom tag libraries that establish a portable standard for common processing tasks in JSP. JSTL is a major part of the new scriptless authoring style encouraged (and enabled) by the JSP 2.0 specification. This module covers all four JSTL libraries in depth:

  • The core actions, which support JSP expressions for JSP 1.x containers, flow control for procedural processing in JSPs, and resource access.

  • The formatting and internationalization/localization actions, which standardize formatted numeric and date/time output as well as multi-language support. * The SQL actions, which dramatically simplify access to relational data from a JSP.

  • The XML actions, which give JSPs a simple, powerful framework by which to parse, address and transform XML data using XPath and XSLT. Each individual tag in each library is covered, with precise syntactic rules shown in a standard format in the student guide, and JSTL techniques and best practices are discussed for each library. An extensive set of example applications illustrates common usage of each major group of actions, and the module culminates with a wrap-up workshop that brings core, SQL, and XML techniques to bear in a single application.

JSP Training Learning Objectives

  • Explain the fundamentals of HTML and HTTP in the World Wide Web.
  • Describe JavaServer Pages and their relationship to servlets and J2EE generally.
  • Describe how a JSP is translated into a servlet and processed at runtime.
  • Explain the use of directives on JSPs and outline the principal directives.
  • Implement simple JSPs that use Java code in declarations, expressions and scriptlets.
  • Enumerate and use the implicit objects available to scripting elements.
  • Implement an interactive Web application using HTML forms and JSP.
  • Use Java exception handling and JSP error pages to handle errors in JSP applications.
  • Implement session management for a JSP application.
  • Manage cookies to store client-specific information at various scopes and durations.
  • Use JavaBeans to implement effective interactive JSP applications.
  • Describe custom tags in JSP and explain how they are implemented, both using Java and JSP itself, and how they are used.
  • Discuss threading issues in JSP and describe the use of directives to control how threading is handled.
  • Describe the various uses of XML in JSP applications.
  • Deploy a logical Web application to a Web server in a WAR file.
  • Describe the use of the JSP expression language to simplify dynamic page output.
  • Write JSP expressions and implement JSPs that use them in favor of scripts.
  • Implement JSPs that use basic JSTL actions to simplify presentation logic.
  • Decompose a JSP application design into fine-grained, reusable elements including JavaBeans, custom tag handlers and tag files that use JSTL.
  • Use core JSTL actions to complement standard actions, custom actions, and
  • JSP expressions for seamless, script-free page logic.
  • Direct conditional and iterative processing of page content by looping through ranges of numbers, over elements in a collection, or over tokens in a master string.
  • Set locale and time zone information in JSPs, and use them to correctly format numbers, dates and times for all clients.
  • Use resource bundles to manage application strings, and produce the appropriate strings at runtime for a particular client locale.
  • Locate a data source, query for relational data, and parse result sets.
  • Perform updates, inserts and deletes on relational data using SQL actions.
  • Manage queries and updates in transaction contexts.
  • Derive information from parsed XML content using XPath expressions.
  • Implement conditional processing and loops based on XML information.
  • Apply XSLT transformations to XML content.
  • Implement a simple Web service that reads and writes SOAP.
  • Understand and appreciate the role of Java Servlets in the overall Java 2 Enterprise Edition architecture, and as the best Java solution to HTTP application development.
  • Use request and response objects provided to a servlet to read CGI parameters and to produce an HTML response.
  • Develop interactive Web applications using HTML forms and servlets.
  • Manage complex conversations with HTTP clients using session attributes.
  • Understand the role of JDBC in Java persistence code, and use JDBC for persistence in servlet applications.
  • Preserve portability and ease of administration for a servlet application by parameterizing servlet code, using initialization parameters, properties files, and JNDI.
  • Use JavaBeans classes to share complex business data between components.
  • Implement filters to adapt existing servlets with new features, and to maximize the decomposition of logic between vertical business functions and horizontal facilities.

JSP Training Prerequisites

Java programming experience is required.  Knowledge of HTML and background in Web applications, and/or Java programming experience, are helpful but not necessary.

JSP Training Outline

Module 1. Introduction to JavaServer Pages

  1. Web Applications
    • The World Wide Web
    • HTML Web Servers
    • HTTP
    • Dynamic Web Pages
    • CGI
    • Java Web Technologies
    • Servlets
    • JSP
  2. JSP Architecture
    • JSP Containers
    • Servlet Architecture
    • Page Translation
    • Types of JSP
    • Content Directives
    • Content Type
    • Buffering
    • Scripting Elements
    • JSP Expressions
    • Standard Actions
    • Custom Actions and JSTL
    • Objects and Scopes
    • Implicit Objects
    • JSP Lifecycle
  3. Scripting Elements
    • Translation of Template
    • Content Scriptlets
    • Expressions Declarations
    • Dos and Don'ts
    • Implicit Objects for Scriptlets
    • The request Object
    • The response Object
    • The out Object
  4. Interactive JSP Applications
    • HTML Forms
    • Reading CGI Parameters
    • JSPs and Java Classes
    • Error Handling
    • Session Management
    • The Session API
    • Cookies and JSP
  5. Using JavaBeans
    • Separating Presentation and Business Logic
    • JSP Actions
    • JavaBeans
    • Working with Properties and Using Form Parameters with Beans
    • Objects and Scopes
    • Working with Vectors
  6. The Expression Language and the JSTL
    • Going Scriptless
    • The JSP Expression Language EL
    • Syntax Type Coercion
    • Error Handling
    • Implicit Objects for EL
    • The JSP Standard Tag Library
    • Role of JSTL
    • The Core Actions
    • Using Beans with JSTL
    • The Formatting Actions
    • Scripts vs. EL/JSTL
  7. Advanced JSP Features
    • Web Components
    • Forwarding
    • Inclusion
    • Passing Parameters
    • Custom Tag Libraries
    • Tag Library Architecture
    • Implementing in Java or JSP
    • Threads
    • Strategies for Thread Safety
    • XML and JSP
    • JSP for Web Service
  8. Effective JSTL
    • The JSP Standard Tag Library
    • JSTL Namespaces
    • Going Scriptless
    • Object Instantiation
    • Sharing Objects
    • Decomposition
    • Parameterization
  9. The Core Actions
    • The JSTL Core Library
    • Gotchas
    • Conditional Processing
    • Iterative Processing
    • Iterating Over Maps
    • Tokenizing Strings
    • Catching Exceptions
    • Resource Access
  10. The Formatting and i18n Actions
    • The JSTL Formatting Library
    • Locales
    • Determining Locale Time Zones
    • Setting Locale and Time Zone
    • Formatting and Parsing Dates
    • Formatting and Parsing Numbers
    • Internationalization
    • Working with Resource Bundles
    • Supporting Multiple Languages
  11. The SQL Actions
    • The JSTL SQL Library
    • Using Relational Data
    • Connecting with a DriverManager
    • Connecting via a DataSource
    • The Result Interface
    • Making a Query
    • Inserts, Updates and Deletes
    • Parameterized SQL Transactions
  12. The XML Actions
    • The JSTL XML Library
    • Using XML
    • XML Data Sources
    • Parsing and Addressing
    • Using XPath in JSTL
    • XPath vs. EL
    • XPath Context
    • Implicit Objects for XPath
    • Conditional Processing
    • Iterative Processing
    • Changing XPath Context
    • Working with XML Namespaces
    • Using XSLT Chaining Transformations
    • Reading XML from the Request Body
    • XML and SOAP Web Services
  13. Servlets
    • Architecture Servlets
    • Architecture Servlet and HttpServlet
    • Request and Response
    • Reading Request Parameters
    • Producing an HTML Response
    • Redirecting the Web Server
    • Deployment Descriptors
    • Servlets Life Cycle
    • Relationship to the Container
  14. Interactive Web Applications
    • Building an HTML Interface
    • HTML Forms
    • Handling Form
    • Input Application Architecture
    • Single-Servlet Model
    • Multiple-Servlet Model
    • Routing Servlet Model
    • Template Parsers
  15. Session Management
    • Managing Client State Sessions
    • Session Implementations
    • HttpSession Session
    • Attributes
    • Session Events
    • Invalidating Sessions
  16. Database Access
    • JDBC
    • JDBC Drivers
    • Using JDBC in a Servlet
    • Data Access Objects
    • Threading Issues
    • Transactions
    • Connection Pooling
  17. Configuration and Context
    • The Need for Configuration
    • Initialization Parameters
    • Properties
    • Files
    • JNDI and the Component Environment
    • JDBC Data Sources
    • Working with XML Data
  18. Filters
    • Servlet Filters
    • Uses for Filters
    • Building a Filter
    • Filter Configuration and Context Filter Chains
    • Deploying Filters

Appendix A.  Learning Resources

System Requirements
Hardware – minimal: Pentium 500MHz, 128 meg RAM, 500 meg HD.
Hardware – recommended:   Pentium 1.5gHz, 512 meg RAM, 1 gig HD.
Operating system:

This course can be taught on Windows or Linux systems.