The Struts dispatcher cannot be found. This is usually caused by using Struts
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了The Struts dispatcher cannot be found. This is usually caused by using Struts相关的知识,希望对你有一定的参考价值。
对于struts2中的问题:
org.apache.jasper.JasperException: 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.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
root cause
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]
org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:60)
org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:52)
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:49)
org.apache.jsp.login_jsp._jspx_meth_s_005ftextfield_005f0(login_jsp.java:106)
org.apache.jsp.login_jsp._jspService(login_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
解决方案是:
在web.xml页面中
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
以上是关于The Struts dispatcher cannot be found. This is usually caused by using Struts的主要内容,如果未能解决你的问题,请参考以下文章
The Struts dispatcher cannot be found. This is usually caused by using Struts
Can not find the tag library descriptor for "/struts-tags"`
struts2文件下载出现Can not find a java.io.InputStream with the name的错误
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter