jsp中使用struts标签出错:The Struts dispatcher cannot b...

struts2 标签出错: 
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]

出现这个问题的原因一般都是按照默认的情况配置了web.xml:
 <filter>
   <filter-name>struts2</filter-name>
   <filter-class>
   org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
   </filter-class>
  </filter>
  <filter-mapping>
   <filter-name>struts2</filter-name>
   <url-pattern>*.action</url-pattern>

  </filter-mapping>

只要修<url-pattern>/*</url-pattern>问题就解决了...

你可能感兴趣的:(jsp中使用struts标签出错:The Struts dispatcher cannot b...)