This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in optionsCollection tag: Failed to obtain specified collection

 
Abdul Wahab
Ranch Hand
Posts: 49
Eclipse IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
i am beginner in struts framework. I want to list values using optionsCollection tag but i am getting Error.
javax.servlet.ServletException: javax.servlet.jsp.JspException: Failed to obtain specified collection
it works fine when using jstl tag. Please help on this error.

Below is my jsp page.


My Dao page


MyAction class



My ActionForm

Moreover i want to know
1. why there is no event attributes (onclick, onblur) in <hption> tag. something like


Any help on this will be highly appreciated....



 
Guy Belpa
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts may require an indexed getter method for for your collection. Adding that to your form may allow the select/optionsCollection tag to work correctly ...
 
Guy Belpa
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Struts may require an indexed getter method for for your collection. Adding that to your form may allow the select/optionsCollection tag to work correctly ..
 
Guy Belpa
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure this action forwards to the JSP, and then call the URL for the action (/myaction.do) rather than calling the JSP directly (/mypage.jsp).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic