last entry is "<c:forTokens"

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- From: "Martin Gainty" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, April 27, 2007 9:43 AM
Subject: Re: <logic:iterate> how to test the 1st and last iteration ?


Morning All

<c:forEach will support values in a comma delimited String but has problems with nulls

If you want to be more specific on what is used for delims then
load all of your values in to StringTokenizer object then do <c:forEach
http://javaboutique.internet.com/tutorials/Struts_EL/index-3.html

HTH
M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed. If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- From: "Olivier THIERRY" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, April 27, 2007 9:25 AM
Subject: Re: <logic:iterate> how to test the 1st and last iteration ?


Use <bean:size> tag to have the collection's length ;)

2007/4/27, piloupy GOTTAPIL <[EMAIL PROTECTED]>:

Thanks for the answer, but how I can get the collection's length ?

I try to avoid any use of scriptlet if possible.

piloupy

On 4/27/07, Olivier THIERRY <[EMAIL PROTECTED]> wrote:
> You have an indexId attribute on the logic:iterate tag.
> This indexId attribute sets the name of a JSP scope variable that will
> contain the index in the loop.
> Then you can test the value of this variable with the logic:equal.
>
> Olivier
>
> 2007/4/27, piloupy GOTTAPIL <[EMAIL PROTECTED]>:
> >
> > 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: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

---------------------------------------------------------------------
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]




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

Reply via email to