<%-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --%> <%@ 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