Is urlrewrite App Server dependent cause I tried this on Sun Glassfish app. server.
On Fri, Nov 13, 2009 at 8:51 AM, jayantS <sukh...@gmail.com> wrote:
> <a href="world.jsp?country=usa&city=nyc">Click Here</a></p>
>> > > > <outbound-rule>
>> > > > <from>^/world.jsp\.?country=([a-z]+)&city=([a-z]+)$</from>
>> > > > <to>/world/$1/$2</to>
>> > > > </outbound-rule>
I find it strange that this would work for the general case as you're
using just "a" which I thought doesn't call encodeURL?
But anyway, there is a problem with ampersands in outbound URLs I've
noticed in that they're sometimes encoded and sometimes not (in our
code base it's something to do with the struts tag, e.g. s:a seemingly
sometimes encoding before uwf gets the URL, sometimes not).
So what you think your outbound rule sees is:
/world.jsp?country=us&city=dc
What it might be seeing (verbatim):
/world.jsp?country=us&city=dc
I would try the following rule:
<from>^/world.jsp\.?country=([a-z]+)&(?:amp;)?city=([a-z]+)$</from>
Which would work for either case. Assuming your <a> tags are calling
response.encodeURL() which I'm unconvinced they are. It looks like
you're using Struts 1 in which case you might want to try using the
<html:link> tag[1] instead.
greets,
Wim
[1]:http://struts.apache.org/1.3.10/struts-taglib/tagreference.html#html:link