struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laxmikant <laxmikant.rui...@gmail.com>
Subject Re: <logic:iterate> how to test the 1st and last iteration ?
Date Fri, 27 Apr 2007 18:17:38 GMT

Hi

Try to use following code, might be helpful
<logic:iterate id="e" name="myCollection" indexId="index" >
      <bean:write name="e" property="name" />${index},
</logic:iterate>


Laxmikant



piloupy GOTTAPIL wrote:
> 
> Hi,
> 
> What I want to do is quite simple. I'd like to know how to test in a
> <logic:iterate> when I'm at the first or last iteration.
> 
> My present problem is to parse a collection of String and display the
> results like this :
> 
> ### CODE : begin ###
> value1, value2, value3
> ### CODE : end ###
> 
> And as you can see, for the last iteration, I mustn't displey the
> comma character.
> 
> My present code is :
> 
> ### CODE : begin ###
> <logic:iterate id="e" name="myCollection">
>   <bean:write name="e" property="name" />,
> </logic:iterate>
> ### CODE : end ###
> 
> Thanks in advance :)
> 
> piloupy
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%3Clogic%3Aiterate%3E-how-to-test-the-1st-and-last-iteration---tf3657445.html#a10224066
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message