struts2错误:The Struts dispatcher cannot be found.

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>&lt;filter&gt;<br><wbr>&lt;filter-name&gt;struts2&lt;/filter-name&gt;<br><wbr>&lt;filter-class&gt;<br><wbr>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteF<wbr>ilter<br><wbr>&lt;/filter-class&gt;<br><wbr>&lt;/filter&gt;<br><wbr>&lt;filter-mapping&gt;<br><wbr>&lt;filter-name&gt;struts2&lt;/filter-name&gt;<br><wbr>&lt;url-pattern&gt;*.action&lt;/url-pattern&gt;<br><wbr>&lt;/filter-mapping&gt;<br><wbr><wbr><br><span style="color:#ff00; word-wrap:normal; word-break:normal">&lt;filter-mapping&gt;<br> &lt;filter-name&gt;struts2&lt;/filter-name&gt;<br> &lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt;<br> &lt;/filter-mapping&gt;</span></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>

你可能感兴趣的:(dispatcher)