工程中用到了struts2,index.jsp中使用jsp:forward命令跳转来执行action,web.xml中需要做如下配置:
[xml]<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>[/xml]
不明白为什么要这样配置,有时间好好研究一下。如果觉得配置web.xml很麻烦,不如使用jstl的redirect标签来跳转,可以达到一样的效果。
[xml]<c:redirect url="/login.action"></c:redirect>[/xml]