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.message._404_jsp._jspService(_404_jsp.java:159)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
<wbr></wbr>
解决办法:加了标签后,出现此问题
其实最后只在原配置基础上加上.jsp过滤即可
<wbr><filter><br><wbr><filter-name>struts2</filter-name><br><wbr><filter-class><br><wbr>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteF<wbr>ilter<br><wbr></filter-class><br><wbr></filter><br><wbr><filter-mapping><br><wbr><filter-name>struts2</filter-name><br><wbr><url-pattern>*.action</url-pattern><br><wbr></filter-mapping><br><wbr><wbr><br><span style="color:#ff00; word-wrap:normal; word-break:normal"><filter-mapping><br>
<filter-name>struts2</filter-name><br>
<url-pattern>*.jsp</url-pattern><br>
</filter-mapping></span></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
本文详细介绍了在使用Struts2标签时遇到'无法找到StrutsDispatcher'错误的解决方法,通过添加相应的过滤器配置即可顺利使用Struts2标签。
533

被折叠的 条评论
为什么被折叠?



