Java Server Pages

API

Tutorials:

examples: JWS examples (note: these are all pre 2.0)

JavaServer Pages

( 1, 2, 3 , 4 , 5 ) Sales Pitch and SUN .( 1.3)

What is a JSP page? (1.3, Hall)

JavaServer Pages are Web pages that contain a combination of HTML and code written in a scripting language such as Java. The two primary benefits of JavaServer Pages are:

  1. They cleanly separate page presentation from page content (presentation logic vs. application logic) in dynamically generated pages by letting you call objects from within a JavaServer page
  2. They are automatically recompiled by the PageCompileServlet when changes are made to the source file. (JavaServer Pages are processed by a special servlet called the PageCompileServlet.)

Presentation aspects are emphasized in JSPs, if your primary purpose is presentation, then use JSP. You could then use a Java Bean for the implementation of the Business logic.

Introductions

SUNs Syntax reference card (2.0) and 1.2

What's it look like? How do I know if it did something wrong?

JSP Scripting Elements

JSP Scripting elements let you insert code into the serlvet that will be generated from the JSP. (Hall has good simple examples)

Hall's tutorial, pdf from Hall book JSP Scripting Elements,
and the J2EE tutorial Ch 16 Scripting in JSP pages, also 1.2 reference

Directives and Action Elements

Directives and J2EE section (Ch 13)
Enable you to modify certain characteristics of the JavaServer page and resulting servlet. These specifics include the scripting language and the packages used. They tell the compiler information at compile time. Changed with version 1.2 to use only page and include directives with attribute (many more directives were used in earlier versions (above))

Actions (or elements)

Also the J2EE tutorial on JavaBeans Components in JSPs

Objects: Implicit and Application Specific

Using Objects within JSPs(what is implicitly given to you and using your own) ( newer)

Reusing Content in JSP pages

Reusing Content in JSP pages J2EE tutorial and transferring control to another web component

More

Developing XML Solutions with JavaServer[tm] Pages

Comments in the jsp page

Form processing using JSP from jGuru and What happens to the Form data
look around on this tutorial for more informative pages, for example exception handling

Finally - about JSP to servlet code, see The Life Cycle of a JSP Page . Here is newer version with 2.0 stuff
In the jGuru tutorial an example translation from JSP to servlet

Blueprints - Could be quite nice for examples

and Troubleshooting Common problems and Their Solutions