Problem with html:select inside of c:foreach

J

javaguy

I have code like this:

<c:forEach items="${myOrders}" var="orders" varStatus="loop">
<tr>
<td>
<html-el:select property="${orders.myStatus}">
<html-el:eek:ption value="MyValue1"/>
<html-el:eek:ption value="MyValue2"/>
</html-el:select>
</td>
</tr>
</c:forEach>

There is a getMyStatus(), setMyStatus() in the myOrders collection.

When I run this code I get javax.servlet.jsp.jspException: No getter
method available for property 1 for bean under name
org.apache.struts.taglib.html.BEAN.

If I replace the html-el:select with a normal <select> then the page is
rendered OK. It also means that, for now, my page has some funky stuff
to fetch the results of that select so I'm not home free.

So, what is going on here? I've found no references in groups or
Google to this condition. Generally, whenever the groups say "forEach"
and "select", what is being talked about is using the forEach inside of
the select, and not the way I have it here.

Any understanding is greatly appreciated.
Jerome.
 
J

javaguy

Aaack! Fixed my own problem.

I forgot something I had already done elsewhere in my codebase
(different JSP file). The select must be:
<html-el:select indexed="true" name="orders" property="myStatus">

and things work perfectly.

Sorry for bothering the lot of you.

Jerome.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top