peony2012 / urlrewritefilter

Automatically exported from code.google.com/p/urlrewritefilter
Other
0 stars 0 forks source link

urlrewrite outbound rule is processed twice #144

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, I am finding my (outbound) rewrite rules are processed twice. 

My urlrewrite.xml:

  <rule>
    <from>^(.*)buildId\_[^_]+\_(.+\.(?:js|css))$</from>
    <to>$1$2</to>
    <set type="expires">1 year</set>
    <set name="Cache-Control" type="response-header">max-age=31536000</set>
  </rule>

  <outbound-rule>
    <from>(.*/)([^\/]+(?:js|css))$</from>
    <to>$1buildId_543543545_$2</to>
  </outbound-rule>

My web.xml:

    <filter-mapping>
        <filter-name>UrlRewriteFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

I expect the following link in the HTML

<link rel="stylesheet" href='/css/buildId_543543545_style.css' type="text/css" 
/>

But what I get is HTML like this:

<link rel="stylesheet" 
href='/css/buildId_543543545_buildId_543543545_style.css' type="text/css" />

I tried the versions 4.0.2, 4.0.3, 4.0.4 on Windows 7. My Maven-based web 
application uses Spring MVC. I guess Spring MVC will do some forwards 
internally but I don't for sure.

If this is not enough information to reproduce the problem let me know. The I 
could try to provide a minimum webapp that reproduces the problem.

There is a similar problem reported in the discussion group: 
https://groups.google.com/forum/#!searchin/urlrewrite/dispatcher$20forward/urlre
write/jZtMh2BAg3w/-Myq5OCNqekJ

Original issue reported on code.google.com by rwoo@gmx.de on 19 Jun 2013 at 8:28