Back to Tomcat

JSP Samples

webapps/examples/jsp/index.html

11.0.227.1 KB
Original Source

JSP Samples

This is a collection of samples demonstrating the usage of different parts of the Jakarta Pages (JSP) specification. Both JSP 2.0 and JSP 1.2 examples are presented below.

These examples will only work when these pages are being served by a servlet engine; of course, we recommend Tomcat. They will not work if you are viewing these pages via a "file://..." URL.

To navigate your way through the examples, the following icons will help:

  • Execute the example
  • Look at the source code for the example
  • Return to this screen

Tip: For session scoped beans to work, the cookies must be enabled. This can be done using browser options.

JSP 2.0 Examples

Expression Language
Basic Arithmetic
Basic Comparisons
Implicit Objects
Functions
Composite Expressions
SimpleTag Handlers and JSP Fragments
---
Hello World Tag
Repeat Tag
Book Example
Tag Files
---
Hello World Tag File
Panel Tag File
Display Products Example
New JSP XML Syntax (.jspx)
---
XHTML Basic Example
SVG (Scalable Vector Graphics)
Other JSP 2.0 Features
---
<jsp:attribute> and <jsp:body>
Shuffle Example
Attributes With Dynamic Names
JSP Configuration

JSP 1.2 Examples

| Numberguess | Execute | Source | | Date | Execute | Source | | Snoop | Execute | Source | | ErrorPage | Execute | Source | | Carts | Execute | Source | | Checkbox | Execute | Source | | Color | Execute | Source | | Include | Execute | Source | | Forward | Execute | Source | | JSP-Servlet-JSP | Execute | Source | | Custom tag example | Execute | Source | | XML syntax example | Execute | Source |

Tag Plugins

| If | Execute | Source | | ForEach | Execute | Source | | Choose | Execute | Source |

Other Examples

| FORM Authentication | Execute | | | Example that demonstrates protecting a resource and using Form-Based authentication. To access the page the user must have role of either "tomcat" or "role1". By default no user is configured to have these roles. |