Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Problem with the drop down box using Struts tags

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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(); %>

<html:option value='<%= prKey %>' >
<bean:write name='transaction' property='PRKey'/> (or reuse <%= prKey %>)
</html:option>
</logic:iterate>
</html:select>
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic