On Thu, 25 Apr 2002, Jing Zhou wrote:
> Date: Thu, 25 Apr 2002 15:09:31 -0500
> From: Jing Zhou <[EMAIL PROTECTED]>
> Reply-To: Struts Developers List <[EMAIL PROTECTED]>
> To: Struts Developers List <[EMAIL PROTECTED]>
> Subject: Re: Another way to find mapped properties
>
> I browsed the Appendix A for EL and got the following
> thoughts:
>
> Suppose STRUTS taglib is running in a JSTL environment
> with EL engine enabled. We could have a construct like
>
> <c:forEach var="i" items="some_address_index_collection">
> <bean:write name="customer" property="address[${i}]"/>
> </c:forEach>
>
> I hope the EL will set the property attribute with string
> literal address[0], address[1], ... at runtime.
>
> Craig, is the above construct legal in the future? It looks
> to me pretty neat when considering arbitrary string literal
> could be set by the EL engine (it also solves my problem)
>
We won't know for sure until we actually modify Struts to support the EL,
but I anticipate that you would (in the future) code this example as
follows:
<c:forEach var="i" items=some_address_index_collection">
<bean:write value="${customer.address[i]}"/>
</c:forEach>
The reasons for the changes:
* I would like to use a new attribute ("value") on the Struts tags
for the places that EL expressions are legal, so that we don't
mess up the existing use of the "name" and "property" attributes
where the old syntax would continue to work as it always has.
In addition, use of "value" as an attribute is consistent with the
JSTL conventions for attribute names.
* In the JSTL EL, once you are inside "${...}" then everything is
interpreted as an expression - you don't need nested "${i}" to
make "i" be treated as a variable reference.
Until after Struts 1.1, this is all just drawing on a whiteboard, but it's
definitely the direction I am thinking about.
> Jing
Craig
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>