Thanks Antonio,

I think I was just feeling a little insecure about the code I was writing. Ultimately, I just want to make sure that I'm doing things the right way. If using JSTL falls within the scope of best practices for pulling out putList attribute values, I'm satisfied.

To answer your question, I didn't like the approach because I managed to build most of my application without the Core JSTL (using the Struts tags with OGNL support instead). Introducing another taglib just felt wrong. For some reason, the tests I did using the "iterate" tag didn't work -- probably because I don't fully grasp the OGNL syntax yet.

Conclusion: Looping over the attribute sent in from the named putList is the right way to pull values out. If using the JSTL Core "forEach" tag is acceptable, I'm satisfied. However, I'll be more satisfied when I can get it to work with the struts "iterate" tag.

Thanks again,

Eric Rank






On Dec 31, 2006, at 4:24 AM, Antonio Petrelli wrote:

Eric Rank ha scritto:
Hi all,

I am trying to insert items from a putList defined in my tiles.xml file in a template file. The only way that I can seem to do it is by using the following process

1. make the putList 'List' accessible on the page with <tiles:useAttribute name="myPutList" />
2. sending that variable in to a JSTL Core taglib forEach loop
3. using <tiles:insertDefinition name="${putListItem}" />


I think your code is perfect, so why don't you like it?
Tiles 2 does not depend on Struts anymore, so the "best practice" is to use the most generic tag libraries, that is JSTL. Instead of <tiles:useAttribute> you can use <tiles:importAttribute> that does not create a scripting variable, but only a page context attribute.
Anyway you can use all the "iterate" tags you like.

Antonio

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



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

Reply via email to