<%@ page language="java" contentType="text/html; charset=UTF-8" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> Bean tag examples View Source Return to examples page

Bean tag examples


<bean:write>

1. Display bean properties

Boolean:
Double:
Float:
Integer:
Long integer:
Short integer:
String:
Date:

2. Formatting output

Formatted number (using format):
Formatted number (using formatKey):
Formatted date (using format):
Formatted date (using formatKey):

3. Display values from collections, arrays and nested beans

List entry:
Array entry:
Nested property:

4. Filtering HTML tags in output

Filtered text:
Unfiltered text:

<bean:define>

String value:
Bean:

<bean:header>

Accept-Encodings:
<%-- Not working in webappcabaret

<bean:include>

--%>

<bean:message>

<bean:parameters>

Parameter 1:
Parameter 2:
Parameter 3:

<bean:size>

List size:

<bean:cookie>

Display the properties of our current session ID cookie (if there is one):

<%-- Fails on Tomcat 3.3.1a --%>
Property NameValue
comment
domain
maxAge
name
path
secure
value
version

Display the properties of an undefined cookie that was given the default value UNKNOWN_VALUE:

<%-- Fails on Tomcat 3.3.1a --%>
Property NameValue
comment
domain
maxAge
name
path
secure
value
version