You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by rmanchu <rm...@gmail.com> on 2005/04/30 01:41:10 UTC
Actions with wildcards
hi guys
is there an order in which actions are associated with?
action1 ... path="/action/*/delete"
action2 ... path="/action/*/*"
if they were in that order, is it guaranteed that action1 will be
evaluated first and then action2?
thanx
riyaz
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Actions with wildcards
Posted by Joe Germuska <Jo...@Germuska.com>.
At 6:05 AM -0700 4/30/05, rmanchu wrote:
>Joe Germuska wrote:
>
>>You'll see that it goes through all of its configs before
>>returning, which means that the last match should win. It's not
>>explicitly documented as such in the JavaDoc.
>>
>>Hope that helps.
>>
>>Joe
>
>thanx joe. ok i guess that means and intelligent ordering of the
>actions should get struts to call the required action that I want
>right?
>
>but as there is not policy that states/guarantees this (what if the
>implementation changes?) its best not use it this way?
It seems appropriate that the behavior should be deterministic. I'd
suggest filing an enhancement Bugzilla ticket asking for a formal
documentation/verification/decision about the behavior. I doubt we'd
intentionally change it anyway, since there's a strong commitment to
compatibility, but if it were added to the JavaDoc and the user
guide, that would reinforce the "contract".
http://issues.apache.org/bugzilla/enter_bug.cgi?product=Struts
Best,
Joe
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Actions with wildcards
Posted by rmanchu <rm...@gmail.com>.
Joe Germuska wrote:
> You'll see that it goes through all of its configs before returning,
> which means that the last match should win. It's not explicitly
> documented as such in the JavaDoc.
>
> Hope that helps.
>
> Joe
thanx joe. ok i guess that means and intelligent ordering of the actions
should get struts to call the required action that I want right?
but as there is not policy that states/guarantees this (what if the
implementation changes?) its best not use it this way?
thanx joe
riyaz
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Actions with wildcards
Posted by Joe Germuska <Jo...@Germuska.com>.
I haven't run any serious tests with this, but the ActionConfigs are
all managed in lists, which means that they are stored in the order
in which Struts encounters them while reading config files.
The key class here is ActionConfigMatcher, which has all
responsibility for matching a String path if there are no exact
matches:
http://svn.apache.org/repos/asf/struts/core/trunk/src/share/org/apache/struts/config/ActionConfigMatcher.java
You'll see that it goes through all of its configs before returning,
which means that the last match should win. It's not explicitly
documented as such in the JavaDoc.
Hope that helps.
Joe
At 4:41 PM -0700 4/29/05, rmanchu wrote:
>hi guys
>
>is there an order in which actions are associated with?
>
>action1 ... path="/action/*/delete"
>action2 ... path="/action/*/*"
>
>if they were in that order, is it guaranteed that action1 will be
>evaluated first and then action2?
>
>thanx
>riyaz
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org