Java Server Pages
Duration
Two to Three Days (2 days if taught in conjunction with servlet programming)
Audience
This course is designed for content developers and programmers who will write J2EE applications.
Pre-requisites
The student should have experience with Java programming and HTML.
Description
This course is designed to teach the student how to write Java 2 Enterprise Edition (J2EE) applications using Java Server Pages and related technologies.
Topics
- Introduction to the workshop
- Web architecture review
- Introduction to Java Server Pages
- Installing and configuring a JSP container
- JSP syntax
- Calling Java beans from a JSP
- JSPs and JDBC
- Sessions
- Writing tag libraries
- JSPs and XML
- Introduction to servlets
- Introduction to web applications
- Combing JSPs and servlets
Course Outline
Web Architecture Review
- The HTTP Protocol
- HTML Review
Introduction to JavaServer Pages
- The Common Gateway Interface (CGI)
- Alternatives to CGI
- Microsoft's ASP Overview
- What is Java2 Enterprise Edition?
- Introduction to Servlets
- Introduction to JavaServer Pages
Installing and Configuring a JSP Container
- Basic Requirements
- Installing and Configuring a JSP Container
- Logging and Debugging Tips
JSP Syntax
- JSP Comments
- Quoting, Escapes and Entities
- Template Data
- Scripting Elements (Scriptlets)
- JSP Directives
- Implicit Objects
- Accessing Client Arguments
- JSP Expressions
- Action Elements
- Exceptions and Error Processing
Calling JavaBeans from a JSP
- Separating Content from Presentation
- Writing a JavaBean
- Obtaining a JavaBean Reference in a JSP
- JavaBean Scopes
- Accessing JavaBean Properties from a JSP
- Calling JavaBean Methods from a JSP
- Using the Request Object
- Automatic Property Type Conversions
JSPs and JDBC
- Introduction to JDBC
- JDBC Programming Principles
- Connection Pooling
- Architecture Best Practices
Sessions
- What is a Session?
- Maintaining State between Requests
- The session Implicit Object
- Saving and Storing State Attributes
- URL Rewriting and Cookies
Writing Tag Libraries
- What are Tag Libraries and Custom Actions?
- Custom Actions versus JavaBeans
- Writing a Custom Action
- Writing the Tag Library Description
JSPs and XML
- What is XML?
- Why use XML?
- Generating XML from a JSP
- What is XSL?
- Writing simple XSL to convert XML to HTML
- XSL processing on the web server
- XSL processing in the browser
The following topics are omitted if taught in conjunction with the Servlet Programming Class.
Introduction to Servlets
- Choosing Between Servlets and JSPs
- Writing a Simple Servlet
- Servlets and Sessions
Introduction to Web Applications
- J2EE Web Applications
- Web Application Directory Structure
- The Deployment Descriptor
- Creating a WAR File
Combining JSPs and Servlets
- The Model-View-Controller (MVC) Architecture
- Using Sessions and Redirect/Forwarding
- Sample MVC Application