cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thorsten.scherler....@juntadeandalucia.es>
Subject Pros and cons of extension less requests (was Re: Url without extensions - how to match/rewrite)
Date Mon, 10 Dec 2007 08:40:33 GMT
On Fri, 2007-12-07 at 08:52 -0500, Vadim Gritsenko wrote:
> On Dec 7, 2007, at 7:44 AM, Thorsten Scherler wrote:
> 
> > I tried with the regexp matcher but could not found any pattern that
> > matches the documents WITHOUT extensions
> 
> ^[^.]+$
> 
> http://jakarta.apache.org/regexp/applet.html
> 
> Vadim

Thanks Vadim,

I ended up with:

<!-- This will match all extension less requests -->
      <map:match type="regexp" pattern="^[^.]+$">
        <!-- This will match all requests having "/" on the end -->
        <map:match type="regexp" pattern="^(.*)/$">
          <map:match pattern="*/">
            <map:redirect-to uri="../{1}.html" />
          </map:match>
          <map:match pattern="**/*/">
            <map:redirect-to uri="../{2}.html" />
          </map:match>
        </map:match>
        <map:match pattern="**/*">
          <map:redirect-to uri="{2}.html" />
        </map:match>
        <map:match pattern="*">
          <map:redirect-to uri="{1}.html" />
        </map:match>
      </map:match>

One side effect is that the app is now way slower if you use
"extensionless requests". In our application we need the extensions to
trigger the correct pipelines, which I consider the normal usage of
cocoon. By redirecting the request one is causing more processing on the
app which explains the higher response time.

That makes me wonder whether extension less requests makes sense at all
in a multi-output-format environment.

WDYT?

salu2
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


Mime
View raw message