I am using jsp for the view.  I would not want to use a collection or array for a simple "for" construct due to added complexity and excessive object creation.  It just seems wrong.  I need to set one of the values "selected"...
 
<option value="22" selected>22</option>
 
...by comparing the loop variable with a property on my action. 
 
----- Original Message -----
Sent: Thursday, September 11, 2003 7:30 PM
Subject: Re: [OS-webwork] Loop to create days

Greetings,
 
Is the following acceptable ?
 
#foreach( $day in [1..31] )
   <option value="$day">$day</option>
#end
 
What is your concern with using collections or arrays ?
 
----- Original Message -----
To: Webwork
Sent: Friday, September 12, 2003 12:16 AM
Subject: [OS-webwork] Loop to create days

Hi,
 
I would like to create a list of day options for a select like so:
 
<option value="1">1</option>
<option value="2">2</option>
...
<option value="31">31</option>
 
Can I do this without using a collection or array of numbers and iterating through them?
 
Thanks,
 
John.

Reply via email to