Brian Lalor wrote:
Hey, cool! The two books that I can find (of the 3 I own) only cover up to Struts 1.1. The link Laurie sent contains some more info on the wildcard mappings, but it appears that you've gotta use a custom ActionMapping class[1, 2], with the className property of the <action /> element.

I succumbed to a dangerous instinct (hm, I wonder if I can repurpose something from the existing ActionMapping for my needs?) and it paid off. The setParameter() method is: [A] general purpose configuration parameter that can be used to pass extra information to the Action instance selected by this Action. Struts does not itself use this value
    in any way.

So I should be able to use
    <action path="/CATALOG*/..." parameter="{1}" ... >

Yep, that works, though if your action already uses 'parameter' (e.g. if you're extending ForwardAction, DispatchAction, etc.) then overloading the attribute with the wildcard matches gets messy.

To work around that, grab a recent nightly build. That will let you do the following:

  <action path="/foo/*/bar/*" type="...">
    <set-property name="myFoo" value="{1}"/>
    <set-property name="myBar" value="{2}"/>
  </action>

i.e. you can use the substitution patterns in set-property. This gives you a lot more flexibility :-) Credit to Don Brown for making that possible. For more info, see:

http://article.gmane.org/gmane.comp.jakarta.struts.user/108298/match=wildcard+action
http://article.gmane.org/gmane.comp.jakarta.struts.user/108300/match=wildcard+action
http://article.gmane.org/gmane.comp.jakarta.struts.user/108328/match=wildcard+action

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