现在的位置: 首页 > 综合 > 正文

struts2 异常信息:The Struts dispatcher cannot be found.

2012年11月20日 ⁄ 综合 ⁄ 共 428字 ⁄ 字号 评论关闭

异常信息: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.

 

异常原因:如果想要在jsp文件中,采用 struts的tag,那么必须通过web.xml所配置的过滤器访问文件,否则会有异常,即 之前所出现的异常。

 

解决方法:其实只要再加一个过滤设置就可以了:

 

<filter-mapping>  
   
<filter-name>struts2</filter-name>  
   
<url-pattern>*.jsp</url-pattern>  
</filter-mapping>  

抱歉!评论已关闭.