This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes error in optionsCollection tag: Failed to obtain specified collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "error in optionsCollection tag: Failed to obtain specified collection" Watch "error in optionsCollection tag: Failed to obtain specified collection" New topic
Author

error in optionsCollection tag: Failed to obtain specified collection

Abdul Wahab
Ranch Hand

Joined: Dec 09, 2011
Posts: 49

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....




As long as breath left in my body there is hope
Guy Belpa
Ranch Hand

Joined: Nov 21, 2004
Posts: 41
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

Joined: Nov 21, 2004
Posts: 41

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

Joined: Nov 21, 2004
Posts: 41
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).
 
GeeCON Prague 2014
 
subject: error in optionsCollection tag: Failed to obtain specified collection