On Fri, Sep 3, 2010 at 9:54 PM, Fly Steer <flys...@gmail.com> wrote:
> Hi,
>
> We are planning to switch our webapp from Java 5 to Java 6, and one of
> the issues found is that some of the rules stopped working if Java 6
> is used:
>
> <rule>
> <name>My Rule</name>
> <from>^/([\w\\.\_\-\"&&[^\Qdispatch\E^\Qfavicon.ico
> \E^\Q.do\E^\Q.pub\E^\Q.html\E^\Qfavicon\E]]{1,40})$
> </from>
> <to>/somePage.do?id=$1</to>
> </rule>
>
> this rule is an example of intersection.
> When compiling the code with Java 6, this rule is not triggered for
> urls like:
> http://www.mysite.com/123456
I tried this with 3.2, it works for me. Whitespace is significant here
so make sure the entire from is on one line!.
BTW, that rule doesn't do what you might think it does. Character
classes only match individual characters, even when you quote the
strings containing them. In your intersection you match d, i, s, p, a,
t, c, h and thus the word dispatch, but you can't match the entire
word all at once, i.e. chtpasid would match too.
regards,
Wim