Using Struts Bean Tags That Access Bean Properties

This section provides information on the following tags:

  • <bean:define>— Defines a local variable based on a property

  • <bean:write>— Displays a value from a bean

  • <bean:size>— Gets the length of a map or collection

This section uses the Bean Bean page at /StrutsTaglibs/BeanBean.do. The rendered page is shown in Figure 13.4.

Figure 13.4. The Bean Bean page.

This page demonstrates a typical use of each of the tags. The source is shown in Listing 13.6.

Listing 13.6. JSP File Demonstrating Use of Struts Bean Tags Accessing Bean Properties (BeanBean.jsp)
 <%@ page language="java" %> <%@ taglib ...

Get Struts Kick Start now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.