File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Problem with the drop down box using Struts tags 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 "Problem with the drop down box using Struts tags" Watch "Problem with the drop down box using Struts tags" New topic
Author

Problem with the drop down box using Struts tags

kay lin
Ranch Hand

Joined: May 20, 2004
Posts: 132
Hi GURUs:
I am doing a drop down box with Struts, and I have seen previous post on the forum regarding how to do that.

Basically I have 2 classes
InquiryAction and InquiryResult.jsp

here is the code snippet from InquriyAction


and here is where I do the population of the drop down box in my JSP code


However when i test the JSP page on my local app server, i got the following error:

javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN
at org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:301)
at org.apache.struts.taglib.html.SelectTag.doStartTag(SelectTag.java:244)
at jsp_servlet.__inquiryresults._jspService(__inquiryresults.java:544)

I did bind the "inquiryResults" with an arrayList, can somebody tell me what is wrong? thanks...
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Well, for starters, you can't place that bean tag in your html tag.
Try:

<logic:iterate id='transaction' collection='<%= request.getAttribute("inquiryResults") %>'>
<% String prKey = ((TransactionBean)transaction).getPRKey(); %>

<htmlption value='<%= prKey %>' >
<bean:write name='transaction' property='PRKey'/> (or reuse <%= prKey %>)
</htmlption>
</logic:iterate>
</html:select>


A good workman is known by his tools.
Sree Jag
Ranch Hand

Joined: Oct 14, 2003
Posts: 77
or u could simply use <html ptions> tag as follows:


<html:select property="selectedValue"> <html ptions collection="inquiryList" property="idValue" labelProperty="displayValue"/> </html:select>

hope this helps,
Seshu


Sree Jag<br />SCJP 1.4
 
 
subject: Problem with the drop down box using Struts tags
 
Similar Threads
still having problem with logic:iterate tags
struts -- Cannot find bean under name indexedWorkInProgressVO
Question regarding the logic:iterate tag
Can I use Struts tags inside plain HTML tags?
can somebody take a look at my struts--config file?