This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes html:options throws error due to labelProperty attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:options throws error due to labelProperty attribute" Watch "html:options throws error due to labelProperty attribute" New topic
Author

html:options throws error due to labelProperty attribute

Timotius Pamungkas
Greenhorn

Joined: Feb 26, 2005
Posts: 28
Hi all...

I encountered following error (HTTP status 500) during development :

....
javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN
org.apache.struts.taglib.html.OptionsTag.getIterator(OptionsTag.java:407)
org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java:294)
....


And this is due to following snippet in jsp


<html:select name="peopleEntryPsychotestResultForm"
property="psychotestInstitute">
<html ptions name="peopleEntryPsychotestResultForm"
property="psychotestInstituteValues"
labelProperty="psychotestInstituteLabels" />
</html:select>


The problem is in labelProperty. If I removed that attribute, it works (at least, it display desired page). The problem is combo box labels are not defined correctly.
I've checked psychotestInstituteLabels, and it contains correct values. Even if I write tag "property = "psychotestInstituteLabels"", it displays correct value. But when I'm using labelProperty, it becaomes messy.
What happened? In other pages that uses html:select, all labelProperty tag works just fine, only in this page it becomes bad.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Try adding labelName="peopleEntryPsychotestResultForm" to your tag. This link explains why you should do that.


Merrill
Consultant, Sima Solutions
Timotius Pamungkas
Greenhorn

Joined: Feb 26, 2005
Posts: 28
Problem solved. Thanks
 
Consider Paul's rocket mass heater.
 
subject: html:options throws error due to labelProperty attribute
 
Similar Threads
"No name specified" - html:select and html:options
Populating 'html:select' with values in Database
STRUTS - Action form doesn't set for array
html:options throws an exception, help please!
ActionForm doesn't set value from HTML form!