<%@ page language="java" %> <%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %> <%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %> <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %> Test Replacements for struts bean:write Tag

Test Replacements for struts bean:write Tag

Test 1 -- Scalar Variable Lookups

<% pageContext.setAttribute("test1.boolean", new Boolean(true)); pageContext.setAttribute("test1.double", new Double(321.0)); pageContext.setAttribute("test1.float", new Float((float) 123.0)); pageContext.setAttribute("test1.int", new Integer(123)); pageContext.setAttribute("test1.long", new Long(321)); pageContext.setAttribute("test1.short", new Short((short) 987)); pageContext.setAttribute("test1.string", "This is a string"); %> <%-- Notice that the "value" attribute is not "${test1.boolean}". This would be interpreted as the "boolean" attribute of the "test1" scoped variable, whereas this scoped variable is really named "test1.boolean". --%>
Data Type Value
boolean
double
float
int
long
short
String

Test 2 -- Scalar Property Lookups

Data Type Value
boolean
double
float
int
long
short
String

Test 3 - Integer Array And Indexed Lookups

Correct Value Array Result Indexed Result
<%-- Simulated "indexed" arrays, ala Struts, is not available in the EL. --%> N/A

Test 4 - String Array And Indexed Lookups

Correct Value Array Result Indexed Result
<%-- Simulated "indexed" arrays, ala Struts, is not available in the EL. --%> N/A

Test 5 -- Nested Scalar Property Lookups

Data Type Value
boolean
double
float
int
long
short
String

Test 6 - Nested Integer Array And Indexed Lookups

Correct Value Array Result Indexed Result
<%-- Simulated "indexed" arrays, ala Struts, is not available in the EL. --%> N/A