Reply To: Rewrite with Struts2

Splash Forums Rewrite Users Rewrite with Struts2 Reply To: Rewrite with Struts2

#25790

I believe that RewriteFilter should go before StrutsFilter.

Additionally, your filter definition is incorrect:

<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.ocpsoft.rewrite.config.ConfigurationProvider</filter-class>
</filter>

should be

<listener>
   <listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletRequestListener</listener-class>
</listener>

<listener>
   <listener-class>org.ocpsoft.rewrite.servlet.impl.RewriteServletContextListener</listener-class>
</listener>

<filter>
   <filter-name>OCPsoft Rewrite Filter</filter-name>
   <filter-class>org.ocpsoft.rewrite.servlet.RewriteFilter</filter-class>
   <async-supported>true</async-supported>
</filter>
<filter-mapping>
   <filter-name>OCPsoft Rewrite Filter</filter-name>
   <url-pattern>/*</url-pattern>
   <dispatcher>FORWARD</dispatcher>
   <dispatcher>REQUEST</dispatcher>
   <dispatcher>INCLUDE</dispatcher>
   <dispatcher>ASYNC</dispatcher>
   <dispatcher>ERROR</dispatcher>
</filter-mapping>

Which is described in our manual here:

http://ocpsoft.org/rewrite/docs/configuration/install