Table of Contents
CIS 5930-04 – Spring 2001
Introduction
Development of JSP
JSP elements
Architecture
“Hello User” Servlet, Revisited
An Equivalent JSP Page
Remarks
This Lecture Set
References
Overview of JSP
What is a JSP Page?
Translating and Executing JSP Pages
JSP Features
Fixed Template Data
Directives vs Actions
Actions vs Scripting Elements
JSP Directives
Standard Actions
Scripting Elements
Scripting Elements
The Role of Scripting Elements
Is this Related to JavaScript?
Scriptlets
A JSP Page with a Scriplet
Viewing the date.jsp Page
Predefined Variables
Meanings of Predefined Variables
More Predefined Variables
“Compound” Scriptlets
Expressions
Avoiding out.println()
Loops and Tables
Showing Pets
Declarations
The Counter Servlet Revisited
A JSP Counter
Method Declarations
Local Variables
Directives
The import attribute
The Vending Machine Revisited
Vending Machine (Preamble)
Vending Machine (Main Body)
The Selection Viewing Page
Actions and Beans
Features of Scripting Elements
Disadvantages of Scriptlets
Actions
The Standard Actions
Syntax
The Forward Action
Example
Remarks
The jsp:param Element
The Include Action
The Plug-in Action
JavaBeans
Properties
Trigger Properties
Constructor
Elementary Use of Beans in JSP
The “Use Bean” Element.
Getting and Setting Bean Properties
A Simple Example
JSP Page Using the Date Bean
Initializing Beans from the Request
Controlling a Bean’s Scope
Session Beans
An Example
Students Database Revisited
A Database Session Bean
Moving Logic into the Bean
Session Tracking
Session Tracking Code in JSP
The Selection Page
Selection Form Generation
The DBSessionBean Class
Computing the menu Property
Remarks
Exception Handling in JSP
Viewing a Student Entry
The DBSessionBean setKey() Method
Remarks
Displaying the Fields
The Update Page
The Page update.jsp
Remarks
The DBSessionBean setSaved() Method
Lessons
A Quick Tour of Tag Libraries
Motivations
Customized Actions
Hello World
This Lecture
The Tag Library Directive
The Tag Library Descriptor File
TLD File for the “Hello” Example
The TLD tag Element
Remarks
Tag-Handling Classes
Handling Class for the hello Tag
Remarks
Actions that Process their Bodies
An Iterative Element
The Displayed Page
Remarks
Handling Class for the select Tag
The SelectTag doStartTag() Method
Remarks
The SelectTag doAfterBody() Method
Remarks
Handling Class for the field Tag
The FieldTag doStartTag() Method
Remarks
Menu Generated Using selectlib.tld
|