Chapter 8. JSP Standard Actions

Standard actions are tags that are built right into every JSP implementation. These tags can be used without the addition of any additional tag libraries. These actions are very frequently used in JSP, and earlier examples have used them repeatedly. This chapter provides a more in-depth discussion of each of these standard actions, and reveals some subtlety in the usage and application of these workhorse tags.

The standard actions covered within this chapter include the following:

  • <jsp:useBean>

  • <jsp:setProperty>

  • <jsp:getProperty>

  • <jsp:include>

  • <jsp:forward>

  • <jsp:param>

  • <jsp:plugin>

  • <jsp:params>

  • <jsp:fallback>

While there are other standard actions in JSP, they pertain to the creation of tag files, which are covered in more detail in Chapter 11, "Building Your Own Custom JSP Tag Library."

This chapter presents the syntax and most common usage of each of these standard actions. A series of four hands-on examples will guide you through their typical use.

JSP Standard Actions Are Built-in Tags

JSP standard actions are tags that are available in all JSP implementations. This set of available tags has not changed significantly between JSP 1.2 and JSP 2.0. Therefore, you can count on these standard actions to be supported by all JSP containers.

All standard actions are prefixed by jsp: and have the following general form:

<jsp:tagname   ... attributes ....  />

Some standard actions also have a body that can include other tags, typically parameters. For example:

<jsp:tagname ...

Get Beginning JavaServer Pages™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.