ITeye博客

The Struts dispatcher cannot be found

PerfectPlan · 2012-06-18 09:32 · Struts2 · 编程语言 · Markdown

异常:

严重: Servlet.service() for servlet jsp threw exception

The Struts dispatcher cannot be found.  This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]

at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:60)

at org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:44)

at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:48)

at org.apache.jsp.login_jsp._jspx_meth_s_005fform_005f0(login_jsp.java:108)

at org.apache.jsp.login_jsp._jspService(login_jsp.java:79)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

 

解答:

web.xml中struts2过滤器中没有拦截该页面请求,导致jsp页面中的struts2标签无法解析。修改web.xml中struts2过滤器的匹配默认为"/*"即可

评论(1)

  1. #1 楼 · 铃儿响叮当 · 2012-11-18 06:10

    解决了,说的很对~

评论功能维护中,当前仅展示历史评论。