Sometime it's just hard not to say anything.  There are lots of different 
options for 
making this work and you don't have to change to JSTL to do it.  The 
logic:iterate tag is 
absolutely fine, you just have to get the right parameter names.

Thanksfully there is a pattern to how the parameters of the logic:iterate tag 
work, and 
it's brilliant news that they conform to the other Struts tag libraries.  The 
absolutely 
fantastic news is that there is documentation at:
http://struts.apache.org/struts-doc-1.2.7/userGuide/struts-logic.html#iterate

Your code should look like:

<logic:present name="rows" scope="session">
  <logic:iterate name="rows" scope="session"  id="row">
    Hi
  </logic:iterate>
</logic:present>

You'll notice how the same parameter names are used on the logic:present as the 
logic:iterate, means you only have to learn how to use a parameter once and can 
then 
assume it is used the same way on the other tags.

HTH
Kind regards
mc


On 20 Oct 2005 at 12:48, Dave Newton wrote:

> Troy Bull wrote:
> 
> > I have a situation here.  I have an ArrayList of DTO objects in session.
> >
> > <%
> > ArrayList rows = (ArrayList) session.getAttribute("rows");
> > if (rows != null) {
> >  Iterator i = rows.iterator();
> >        while (i.hasNext())
> >        {
> >         NibuSrchVLocalDTO debug = (NibuSrchVLocalDTO)i.next();
> >        out.println("Name: " + debug.getFullName() + "<BR>");
> >        }
> > }
> > %>
> >
> > This code here (scriptlet above this line) works perfectly but
> >
> > <logic:present name="rows" scope="session">
> >  <logic:iterate id="row" scope="session" 
> > collection="rows">Hi</logic:iterate>
> > </logic:present>
> 
> 1) Use JSTL.
> 2) The logic tag doesn't automagically grab stuff from scopes like JSTL 
> does.
> 3) So, if you're dead-set on not using JSTL, either:
>     a) Use the EL version of the struts lib (or if you're on a JSP 2.0 
> server) and say collection="${rows}"
>     b) Do that bean definition stuff (sorry, don't have time to provide 
> reference right now)
> 
> I'd go for the JSTL, though.
> 
> Hmm, I'm looking at this and being deep in a Lisp project right now I 
> might be remembering COMPLETELY incorrectly, so hopefully somebody more 
> awake and smart will jump in. Sorry.
> 
> Dave
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.12.4/143 - Release Date: 19/10/2005
> 



FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.4/143 - Release Date: 19/10/2005


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

Reply via email to