Dale Newfield schrieb:
Kropp, Henning wrote:
I figured it out. I used <s:set/ > for this. Thanks.

<s:iterator value="model.list">
   <s:set name="value">
       <s:property />
   </s:set>
   <custom:tag attr="${value}" />                 </s:iterator>

That will only work if the value you're trying to pass is a string.
It might also add whitespace to either end of that value (due to the whitespace inside your s:set tag.

Why not pass the OGNL expression to your tag as a string and evaluate it inside your custom tag, instead? If you use this custom tag in many places, I predict the extra jsp required to pre-evaluate the OGNL->string will be error-prone...

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


I must add that s:set printed out the string as well. I am not quit sure if its supposed to, but it did. Therefor I even had to encapsulate s:property with a s:param statement. Like this

<s:iterator value="model.list">
  <s:set name="value">
        <s:param name="value">
              <s:property value="top"/>
        </s:param>
  </s:set>
<custom:tag attr="${value}" /> </s:iterator>

This is quite a big block for little I wanted to achieve.

I thought about passing the whole list to the tag too, but somehow it did not feel like the right thing to do, at least as I would have done it. My understanding of struts is not as experienced so if I may ask, why would I need an extra jsp to pre-evaluate the OGNL as string as you proposed?

thx

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to