Oops, never mind, error between keyboard and chair...

Laurie Harper wrote:

Extending the test cases listed below, I believe I've found a bug in the path matching logic. Given the following pair of action mappings:

        <action path="/pathtest/**"
            type="org.apache.struts.actions.ForwardAction"
            parameter="/pt/one-slash-star-slash-two-sstar-suffix.jsp"/>

        <action path="/pathtest/**/suffix"
            type="org.apache.struts.actions.ForwardAction"
            parameter="/pt/one-slash-star-slash-two-sstar-suffix.jsp"/>

Struts allways matches the latter. That is, it matches with "/pathtest/**/suffix" whether the submitted URL ends with "/suffix" or not.

Has anyone seen this? Anyone have a fix or work-around?

L.

Laurie Harper wrote:

Given the following action mappings, I can reach every JSP bar one:

        <action path="/pathtest/"
                type="org.apache.struts.actions.ForwardAction"
                parameter="/pt/root.jsp"/>

        <action path="/pathtest/one"
                type="org.apache.struts.actions.ForwardAction"
                parameter="/pt/one.jsp"/>

        <action path="/pathtest/one/"
                type="org.apache.struts.actions.ForwardAction"
                parameter="/pt/one-slash.jsp"/>

        <action path="/pathtest/one/*"
                type="org.apache.struts.actions.ForwardAction"
                parameter="/pt/one-slash-star.jsp"/>

        <action path="/pathtest/one/*/two"
                type="org.apache.struts.actions.ForwardAction"
                parameter="/pt/one-slash-star-two.jsp"/>

        <action path="/pathtest/one/*/two/"
                type="org.apache.struts.actions.ForwardAction"
                parameter="/pt/one-slash-star-two-slash.jsp"/>

        <action path="/pathtest/one/*/two/**"
                type="org.apache.struts.actions.ForwardAction"
                parameter="/pt/one-slash-star-two-slash-sstar.jsp"/>

The problem mapping is "/pathtest/one/*/two/" (or "/pathtest/one/*/two/**", depending on how you look at it...) Basically, the former is never matched. Requests to ".../two/" and ".../two/whatever..." are both matched by the path with the '**' wildcard expression.

I can probably live with this, given that the ".../two" mapping (no trailing '/') works as expected, but it's inconsistent with the behaviour for single-* mappings.

Is this intentional? Is there a way around it?

L.





--
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/~laurie/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to