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>web

只要修<url-pattern>/*</url-pattern>問題就解決了...apache

相關文章
相關標籤/搜索