struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <david.k...@attws.com>
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
Struts-EL:

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

Or even more JSTL'ish:

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

> -----Original Message-----
> From: Mohan Radhakrishnan [mailto:MohanR@hclcomnet.co.in]
> 
>   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:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message