JSP and JSTL Tutorials - Herong's Tutorial Notes
Dr. Herong Yang, Version 3.09, 2006
JSP and JSTL Tutorials - Herong's Tutorial Notes
Version 3.09
Dr. Herong Yang

Table of Contents

About This Book

Tomcat

  • Installing Tomcat 4.1.18
  • Using Tomcat as a Web Server
  • "Hello world!" Example

JavaServer Pages (JSP)

  • What is JSP?
  • "Hello world!" Java Servlet Class
  • Writing JSP Servlet Class Directly

Execution Context

  • Predefined Objects
  • The "request" Object
  • The "session" Object

JSP Elements

  • Syntactic Elements of a JSP Page
  • Writing JSP Pages in XML Format
  • Directive Elements
  • Action Elements
  • JSP Example - "CurrentTime.jsp"

JSP Sessions and Debugging

  • What Is a Session?
  • The "session" Object
  • Passing Values between Pages
  • HTTP Communication Level Debugging

Using JavaBean Classes

  • The "jsp:useBean" Action Elements
  • Compilation Errors with Tomcat 4.1.18 and JDK 1.4.1
  • Setting and Getting JavaBeans Properties
  • Using JavaBeans as Objects in Scripting Elements
  • Using Java Objects as JavaBeans
  • Refreshing the Loaded Bean Classes

Using Cookies

  • What is a Cookie?
  • Sending and Receiving Cookies
  • Persistent Cookies

Controlling HTTP Response Header Lines

  • HTTP Response Syntax
  • HTTP Response Header Lines
  • Controlling Response Header Lines
  • Viewing Response Header Lines
  • Response Header Lines of Static Files
  • Response Header Lines Affected by jsp:directive.page Elements
  • Setting Header Lines Directly in JSP Pages
  • Generating Non-HTML Entity Body
  • IE 6.0 Bug on Display PDF Data

Localization / Internationalization - Non ASCII Characters in JSP Pages

  • Characters Traveling from JSP Files to Browser Screens
  • ASCII Characters in JSP Pages
  • Presenting Non ASCII Characters in HTML Documents
  • Entering Non ASCII Characters in Java Strings
  • Java Strings - Byte Sequences Encoded for Local Languages
  • Java Strings - Unicode Codes - Local Language Independent
  • Entering Non ASCII Characters as Static HTML Text
  • Static HTML Text - HTML Page
  • Static HTML Text - JSP Page in Standard Syntax
  • Static HTML Text - JSP Page in XML Syntax
  • Supporting Characters from Multiple Languages

JSP Performance

  • Calculating Prime Numbers
  • Response Time of "Hello" Page

JSP Standard Tag Libraries (JSTL)

  • What is JSTL?
  • Installing JSTL 1.0 Implementation - Standard Taglib 1.0.4
  • "Hello world!" with JSTL
  • JSTL in XML Style JSP Pages
  • JSTL Requirements

JSTL Syntax and Expression Language

  • JSTL Syntax
  • Expression Language
  • Literal Data and Named Variables
  • Basic Operators and Operations
  • Implicit Objects
  • Accessing Collection Elements and Object Properties
  • ExpExample.jsp - Expression Example Page
  • pageContext Attributes and JSTL Top Level Identifiers

JSTL - Core Library

  • JJSTL Core Library
  • c:out Action
  • c:set Action
  • c:if Action
  • c:choose Action
  • c:forEach Action
  • c:forTokens Action
  • JSTL Core Example - JstlObjects.jsp
  • JSTL Core Example - JstlPrimeNumbers.jsp

JSP Custom Tag

  • What is a Custom Tag?
  • "Hello world!" Custom Tag
  • How Custom Tag Works

JSP Tag Java Interface

  • javax.servlet.jsp.tagext.* Package
  • BodyTag Interface
  • Implenting BodyTag Interface - TraceTag.java
  • The Servlet Class - TraceTagTest_jsp.java
  • Dummy Implementation of IterationTag Interface - TagSupport Class

JSP Tag Attribute Handling

  • Tag Attribute Setter Method
  • Tag Attribute Setter Method Example - EchoTag.java
  • Tag Attribute Value Type Conversion
  • Tag Attribute Value Type Conversion Example - AttValueTag.java
  • Tag Attribute Value Expression
  • Tag Attribute Value Expression Example - AttObjectTag.java

Tags Working Together

  • Nested Tags
  • Sharing Data with Other Tags

Tomcat 4.1.18 with JDK 1.4.1

  • Upgrading Tomcat 4.1.18 to JDK 1.4.1
  • Compilation Errors with Tomcat 4.1.18 and JDK 1.4.1
  • JavaBean in a Named Package - TempratureConvertorBean.java

Tomcat 5.5.4

  • Installing Tomcat 5.5.4
  • Using Tomcat as a Web Server
  • "Hello world!" Example in JSP

File Upload

  • Requirements for File Upload
  • RFC 1867 - Form-based File Upload in HTML
  • UploadDump.jsp - Dummping Uploaded Files
  • UploadSave.jsp - Saving Uploaded Files
  • Conclusion

Tomcat 5.5.7

  • Installing Tomcat 5.5.7
  • Using Tomcat as a Web Server
  • 'Hello world!' Example in JSP
  • Using JavaBean Classes

References

Key Words: attachment, content-disposition, content_type, cookie, custom tag, debugging, expression language, file upload, GB2312, GBK, header lines, HTTP/1.1, HTTP Response, internationalization, i18n, IterationTag, JavaBeen, JDK, JSP, JSTL, JSTL-EL, J2SE, localization, MIME, named package, pageContext, performance, Perl, Servlet, session, Taglib, TagSupport, tag interface, TLD, Tomcat, unnamed package, Unicode, useBean, UTF-8, XML

Dr. Herong Yang, updated in 2006
JSP and JSTL Tutorials - Herong's Tutorial Notes - Table of Contents