aspose file tools*
The moose likes Struts and the fly likes JSP select tag error: The requested list key 'statelist' could not be resolved Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSP select tag error: The requested list key Watch "JSP select tag error: The requested list key New topic
Author

JSP select tag error: The requested list key 'statelist' could not be resolved

Trevor Goodrich
Greenhorn

Joined: Aug 04, 2012
Posts: 3
Howdy!

So I've looked for a few hours and tried many things to solve my problem, but I can't seem to figure it out. Hopefully you guys can help me!

I'm working on forms in a jsp page with Struts2. The main problem I'm having is that I can't seem to populate a select list from my action class. When I try to load checkout.jsp, I get a server error.
Here's the relevant code:

CheckoutAction.java


struts.xml


checkout.jsp


Right now, I don't have the state validation implemented. I used to and it still didn't work, so I don't believe that's the problem.

Here is the error I am getting:

exception

org.apache.jasper.JasperException: tag 'select', field 'list', name 'state': The requested list key 'statelist' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:415)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:426)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause

tag 'select', field 'list', name 'state': The requested list key 'statelist' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]
org.apache.struts2.components.Component.fieldError(Component.java:240)
org.apache.struts2.components.Component.findValue(Component.java:361)
org.apache.struts2.components.ListUIBean.evaluateExtraParams(ListUIBean.java:80)
org.apache.struts2.components.Select.evaluateExtraParams(Select.java:105)
org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:864)
org.apache.struts2.components.UIBean.end(UIBean.java:516)
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
org.apache.jsp.checkout_jsp._jspx_meth_s_005fselect_005f1(checkout_jsp.java:432)
org.apache.jsp.checkout_jsp._jspService(checkout_jsp.java:155)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:426)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


Any help would be appreciated. Thanks in advance!
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Whenever you were overriding interceptor-stack include all the interceptors which you needed or else Struts2 Framework ignore rest of the interceptors. In your case it's executing only prepare interceptor. I haven't tested it. It's my guessing.




ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Trevor Goodrich
Greenhorn

Joined: Aug 04, 2012
Posts: 3
Ok, so that worked the first time I loaded the page. The list showed up, was populated, and I didn't get a server 500 error. However, the next time I loaded the page, and every time after that, it gives me the same error again. This persists through server restarts, eclipse restarts, and I'd be willing to bet it'd continue after a full computer restart...I'm about to try that now.

Thanks for the advice, it worked for a second! I wasn't aware that it might ignore the prepare interceptor.

Any more thoughts?

Edit: Yes, it persisted after computer restart.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP select tag error: The requested list key 'statelist' could not be resolved