struts2.3.15.1 中jsp:include与jsp:forward的用法

时间:2024-06-01 17:07:44

首先配置好struts2的过滤器:web.xml中的配置

    <filter>
<filter-name>struts-prepare</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts-prepare</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

然后在<url-pattern>/*</url-pattern>后加上

<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>

就可以了...