Bean Tags

The tags that are part of the Bean tag library are used for accessing JavaBeans and their associated properties as well as for defining new beans that are accessible to the remainder of the page via scripting variables and page-scope attributes. Convenient mechanisms to create new beans based on the values of request cookies, headers, and parameters are also provided. Table 8-9 lists the tags within the Bean tag library.

Table 8-9. Custom tags within the Bean tag library

Tag name

Description

cookie

Define a scripting variable based on the value(s) of the specified request cookie.

define

Define a scripting variable based on the value(s) of the specified bean property.

header

Define a scripting variable based on the value(s) of the specified request header.

include

Load the response from a dynamic application request and make it available as a bean.

message

Render an internationalized message string to the response.

page

Expose a specified item from the page context as a bean.

parameter

Define a scripting variable based on the value(s) of the specified request parameter.

resource

Load a web application resource and make it available as a bean.

size

Define a bean containing the number of elements in a Collection or Map.

struts

Expose a named Struts internal configuration object as a bean.

write

Render the value of the specified bean property.

Warning

Many of the tags in this tag library throw a JspException at runtime when they are used incorrectly ...

Get Programming Jakarta Struts, Second Edition 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.