struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <>
Subject RE: Replacement values
Date Mon, 16 Dec 2002 16:42:17 GMT
As other people have described, the "arg0" attribute is taken as a literal value, or as a scriptlet
value.  It isn't interpreted as a bean property.

This is a good reason to use Struts-EL and the JSTL.  Your example would look like this, using

 	<logic-el:iterate id="item" name="myForm" property="x">
 	  <bean-el:message key="somevalue" arg0="${item}"/>

Or even more JSTL'ish:

      <c:forEach var="item" collection="${myForm.x}">
 	  <bean-el:message key="somevalue" arg0="${item}"/>

> -----Original Message-----
> From: Mohan Radhakrishnan []
>   I am trying to iterate over values in my form bean.
> 	<logic:iterate id="item" name="myForm" property="x">
> 	  <bean:message key="somevalue" arg0="item"/>
> 	</logic:iterate>
>   The above prints the string "item" for the replacement value.
>  Shouldn't it print the value iterated over the String[] 
> which is the type
> of the property in my form bean ?
>  Even bean:write throws " bean not found in scope null " error.
>  "myForm" is in the session scope according the config file.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message