Hello Avlesh,
Thanks for your help.
I tried your method, it seems it is not matching the rule.
After I submit from my browser, I get following exception in my
control.
WARNING: /charts/AREVAT%26D
java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher.java:713)
at java.util.regex.Matcher.replaceAll(Matcher.java:813)
at
org.tuckey.web.filters.urlrewrite.RuleBase.executeBase(RuleBase.java:
184)
at org.tuckey.web.filters.urlrewrite.Rule.execute(Rule.java:74)
at
org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:
135)
I am still not able to find the problem.
Thanks,
Ravi
On May 31, 8:46 am, Avlesh Singh <
avl...@gmail.com> wrote:
> I have long been looking for someone to ask a question on using URF
> functions ;)
> Ah .. first Ravi, on a very different note, your regex doesn't make much
> sense. [A-Z0-9&A-Z0-9] is obviously not doing what you think it is. It
> is just a range of characters. Having A-Z on both the sides of the &
> doesn't mean anything good.
>
> However, the problem is not a regex issue. Your regex is good enough to
> "match" the incoming URL. The problem is in <to> part of the rule. After
> matcher's replacement, the forwarded URL reads like this -
> "/charts?symbol=AREVAT*&*D" .. Notice the unexpected behavior. And it is
> rightly so.
>
> The underneath should work fine for your use case:
> <rule>
> <from>^/charts/([a-zA-Z0-9&]+)$</from>
> <to>/charts?symbol=*${escape:$1}*</to>
> </rule>
>
> Cheers
> Avleshhttp://
webklipper.com
>
>
>
> On Sun, May 30, 2010 at 8:15 PM, Ravi <
msr...@gmail.com> wrote:
> > Hello Friends,
>
> > I have a URL which contains Ampersand(&) which is encoded as %26 in
> > query,
> > Example URL:
http://localhost:8888/charts/AREVAT%26D
>
> > Rule what I have written urlfilter.xml
>
> > <rule>
> > <from>^/charts/([A-Z0-9&A-Z0-9]+)</from>
> > <to>/charts?symbol=$1</to>
> > </rule>
>
> > This rule is working fine for all the urls which doesn't contain %26
> > likehttp://localhost:8888/charts/abb
> > When there is encoded ampersand & (i.e %26) the rule is skipping
> > second part of the query string.
> > Ex:
http://localhost:8888/charts/AREVAT%26D
> > In the above URL I am getting first part of the query, i.e
> > AREVAT and %26D is skipped.
>
> > I was expecting something like /charts?symbol=AREVAT%26D
>
> > Could you please let me know where I have gone wrong.
>
> > Thanks,
> > Ravi
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "UrlRewrite" group.
> > To post to this group, send email to
urlre...@googlegroups.com.
> > To unsubscribe from this group, send email to
> >
urlrewrite+...@googlegroups.com<urlrewrite%2Bunsubscribe@googlegrou
ps.com>
> > .