> From: Matthew J. Vincent [mailto:[EMAIL PROTECTED] 
> I need some serious help with Struts.
> I have a page that gets invoked by calling search.do, this in 
> turns calls my SearchAction which gets data from a database 
> to populate a select box in my JSP search.jsp.
> 
> <select name="strainType">
>     <option selected value="">ANY
>     <c:forEach var="strainType" items="${strainTypes}" 
> varStatus="status">
>            <option><c:out value="${strainType}" 
> escapeXml="false"/></option>
>     </c:forEach>
> </select>

You don't have to do the iteration, and since you're familiar with JSTL,
the Struts-EL tags are probably what you want.  Here's an example that
shows a select list of months, which are stored in a Map:

<html-el:select property="calendarMonth">
  <html-el:options collection="months" property="key"
labelProperty="value"/>
</html-el:select>

Putting the form bean in session scope neatly solves the
blank-form-on-validation-error.  It looks like you've done that, but by
not using the Struts tags, you're not giving the framework a chance to
populate the form.

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 



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

Reply via email to