Meaningless Drivel is fun!*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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).
 
Consider Paul's rocket mass heater.
 
subject: error in optionsCollection tag: Failed to obtain specified collection
 
Similar Threads
html optionsCollection Faild to obtain Collection
issue with the optionsCollection,help
Problem With OptionsCollection Tag
Struts2 newbie - HTTP Status 404 - No result defined for action authentication.User and result SUCCE
iterate problem in struts2