Hi,

on my webpage a got a form linked to an 'orderForm' bean.
In that bean a got an arraylist 'numbers' filled with values (with
LabelValueBean).
I thought I have to use the options tag in the following way:

<html:form action="/order">
<html:select property="number">
                  <html:options collection="numbers" property="value"
labelProperty="label"/>
</html:select>
</html:form>

but when I try it I get a:

javax.servlet.jsp.JspException: Cannot find bean under name numbers
 at
org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:343)

 at
org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:194)

I found a workaround in adding the following:
<jsp:useBean id="orderForm" scope="session" class="OrderForm" />

<% pageContext.setAttribute("numbers", orderForm.getNumbers(),
pageContext.SESSION_SCOPE);%>

can someone tell me how do I have to use the select and options tag
correctly ?

Reply via email to