This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Trevor Goodrich
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 485
Eclipse IDE Firefox Browser Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


 
Trevor Goodrich
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic