tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Taylor <>
Subject Re: How do you handle 'rewrite queries' ?
Date Thu, 13 Aug 2009 12:02:41 GMT
Christopher Schultz wrote:
> If you're looking for URL rewriting in Java, you need go no further than
So I had a look at urlrewrite, when you first mentioned it I didnt 
realise you could plug it in as a filter, and it seems to be what I need
> I'm not sure you really need rewriting, since you could just map
> /ws/type/ to the same servlet that handles requests to /
Hi, yes I do need rewrite because I need to be able to change a query like
Release can also be artist,title ectera, the thing is it needs to be 
converted to the value of a parameter called type.

But I create this rule in urlrewrite.xml:

    <to type="redirect">/type=$1&amp;$2</to>

it converts the query to

I enabled debugging when I look at the localhist log , it says
               Rule 0 run called with /ws/1/release/
              matched "from"
              needs to be redirected to /type=release&

it seems it never receives anything after the the last backslash

If I pass the following query (note no ? after last backslash)
it converts query to

and debugging shows
             Rule 0 run called with /ws/1/release/query=fred&fmt=xml
             matched "from"
             needs to be redirected to /type=release&query=fred&fmt=xml

So, does anyone know why the ? causing an issue

thanks for your help Paul

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message