You can do this.

<c:set var="dropDownSize" value="${myActionFormName.dropDownSize}/>
<c:forEach begin="1" end="${dropDownSize}" var="current">
...
</c:forEach>

Brandon Goodin


-----Original Message-----
From: Mark Galbreath [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 1:12 PM
To: 'Struts Users Mailing List'
Subject: RE: Loop In JSP Page


I think the original question implies that the integer can change, which
would require something like

<c:foreach begin="1" end="<%= n %>" var="current">

but I don't know JSTL (yet) and don't know if this is possible.  Otherwise,
the integer would have to captured in the associated Action class and a map
passed back to the ActionForm based on the particular integer.

Mark

-----Original Message-----
From: Tim Torbeyns [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 12:52 PM
To: Struts Users Mailing List
Subject: RE: Loop In JSP Page


or with JSTL

<c:foreach begin="1" end="20" var="current">
   <c:out value="current"/>
</c:foreach>

gives you 1 2 3 4 5 .. 20

Tim


 --- Josh Rayls <[EMAIL PROTECTED]> wrote: > Create a Map in your action
class, put it into the request, and then
> use the
> html:select tag.  Specify the collection as the one you put into the
> request.
>
> -Josh
>
> -----Original Message-----
> From: Anurag Garg [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 11, 2003 7:11 AM
> To: Struts Users Mailing List
> Subject: Loop In JSP Page
>
>
> Hi,
> I have an integer variable in my ActionForm class whose value is say
> 20. Now in my JSP I would like to show a drop down with values 1 till
> 20. Question is how to run a loop in JSP using the struts.
>
> Anurag Garg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

__________________________________________________
Yahoo! Plus - For a better Internet experience
http://uk.promotions.yahoo.com/yplus/yoffer.html

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