%--
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" %>
<%@ taglib uri="http://struts.apache.org/tags-html-el" prefix="html-el" %>
<%@ taglib uri="http://struts.apache.org/tags-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://java.sun.com/jstl/core" 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");
%>
Data Type |
Value |
boolean |
<%-- 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".
--%>
|
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
|