I played with regex pattern and I realized that the example provided in
docs doesn't work [1].
Could you file an issue on jira [2]?

[1] http://struts.apache.org/2.3.1.2/docs/wildcard-mappings.html
[2] https://issues.apache.org/jira/browse/WW

Maurizio Cucchiara

On 24 January 2012 10:34, Mounir Benzid <m...@meetingmasters.de> wrote:

Hi,

I'm having some trouble figuring out how to use the advanced wildcards
feature in struts II.

What I'm trying to do looks as follows

A) <action name="/event/modify/{action}/{eventId:[0-9]+}"
class="xxxx.actions.event.EventAction">
<interceptor-ref name="simpleStack" />
<result name="input">/WEB-INF/pages/myevents/createevent.jsp</result>
<result name="success" type="redirectAction">
<param name="actionName">/display/{action}/{eventId}</param>
</result>
</action>

B) <action name="/display/{action}/{eventId}" method="input"
class="de.mm.moreevent.web.actions.event.EventAction">
<interceptor-ref name="simpleStack" />
<result>/WEB-INF/pages/myevents/createevent.jsp</result>
</action>

There 2 issues with this

A) As long as I don't use any regexp patterns like [0-9]+ in the
configuration struts is happily matching the url against "EventAction"
http://blah/event/modify/edit/123 works perfectly fine.
Though in the above example the regexp in {eventId:[0-9]+} seems to prevent
this.
http://blah/event/modify/edit/123 doesn't get resovled

B) I'm not able to use the same mechanics to redirectAction to another
action (say from A) to B).
I was hoping that "action" and "eventId" are automagically populated
through the value stack in A) and then then matching action B is called.

These are my constants btw:

<constant name="struts.enable.SlashesInActionNames" value="true"/>
<constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/>
<constant name="struts.patternMatcher" value="regex" />

thanks a lot!
- Mounir

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to