The problem with your suggestion is that it works for simple, and
specific cases, but given OGNL "power", there is a large way of cases
when it would break. Like

<s:push value="foo">
       <s:iterator value="bars[#action.index - 1 * Math.PI]">
               <s:textfield name="baz"  />
       </s:iterator>
</s:push>

what would the name be in that case?

musachy

On Thu, Dec 11, 2008 at 5:23 PM, Andreas Joseph Krogh
<andr...@officenet.no> wrote:
> On Thursday 11 December 2008 23:15:35 Musachy Barroso wrote:
>> Now I see what you mean. What 'push' does is to put a value on top of
>> the stack. The name attribute is a string, not an expression, and
>> doesn't use the stack for anything. That is why it wouldn't work.
>> There is a simple workaround tho,
>>
>> you can set a variable for it like:
>>
>> <s:set var="prefix" value="%{''person'}" />
>> .....
>> <s:textfield name="%{#prefix + '.x.y.z'}" />
>> ....
>>  or even
>> <s:textfield name="%{#prefix}.x.y.z'}" />
>>
>> I dont remember if the second option works.
>
> I know the name-attribute is just a String and I think it would be possible 
> without much effort (se how Struts-1.1 does it) to avoid the messy stuff 
> you're suggesting above.
>
> --
> Andreas Joseph Krogh <andr...@officenet.no>
> Senior Software Developer / CEO
> ------------------------+---------------------------------------------+
> OfficeNet AS            | The most difficult thing in the world is to |
> Karenslyst Allé 11      | know how to do a thing and to watch         |
> PO. Box 529 Skøyen      | somebody else doing it wrong, without       |
> 0214 Oslo               | comment.                                    |
> NORWAY                  |                                             |
> Tlf:    +47 24 15 38 90 |                                             |
> Fax:    +47 24 15 38 91 |                                             |
> Mobile: +47 909  56 963 |                                             |
> ------------------------+---------------------------------------------+
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org
For additional commands, e-mail: dev-h...@struts.apache.org

Reply via email to