struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bhaarat Sharma <bhaara...@gmail.com>
Subject Re: why doesnt iterator tag provide 'next'
Date Sun, 31 May 2009 13:58:54 GMT
sadly in my case i need to :(

But this takes us back, the pseudocode you are suggesting is not possible
using s:iterate, I dont think we have the ability to move the cursor (or
current value in top stack) withtin the iterator tag.  Neither does jstl
provide this.  So sadly, will my code have to sit back in time and use
scriptlets.

On Sun, May 31, 2009 at 9:49 AM, Dave Newton <newton.dave@yahoo.com> wrote:

> Bhaarat Sharma wrote:
>
>> how would 'if' help with 'next'.  can you please give an example?
>>
>
> Pseudocode Java; this is something people should be able to figure out for
> themselves. In JSP I might just use the index.
>
> for (Foo curr : foos) {
>    if (alt) {
>        ...
>    } else prev = curr;
>    alt = !alt;
> }
>
> OTOH, I'd probably never *need* to do this.
>
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message