struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mounir Benzid ...@meetingmasters.de>
Subject Re: Does the orrder of wildcard-annotated methods effects greediness?
Date Thu, 08 Mar 2012 12:11:11 GMT

Am 07.03.2012 18:48, schrieb Dave Newton:
> I'm wondering if `struts.mapper.alwaysSelectFullNamespace` would affect
> this.
>
> Dave

Again the same code  (almost the same I removed the leading / in 
value="..." and added the namespace annotation to the example)

@Namespace("/do")
public class CRUDAction  {

    @Override
    @Action(value="some/specificstuff/{thing}",results={@Result(location = "result.jsp")})
    public String execute() throws Exception {...}


    @Override
    @Action(value="some/{thing}", results={@Result(location ="result.jsp")})
    public String input() throws Exception {...}

}


struts.mapper.alwaysSelectFullNamespace=true

and http://localhost/myApp/do/some/specificstuff/eat

gives me

There is no Action mapped for namespace [/do/some/specificstuff/] and
action name [eat] associated with context path [/myApp].


Struts is apparently trying to match the request /do/some/specificstuff/eat
against some namespace /do/some/specificstuff and action "eat"

which of cource doesn't exist.

Well I guess that's exaclty what

alwaysSelectFullNamespace

does.


btw: I'm using the convention plugin too if that matters.



>
> On Wed, Mar 7, 2012 at 12:39 PM, Mounir Benzid<mb@meetingmasters.de>  wrote:
>
>> Here is a simple example showing two methods in the given order
>>
>>     /***************************************************************
>> **********************************/
>>     @Override
>>     @Action(value="/do/some/**specificstuff/{thing}",
>> results={@Result(location = "result.jsp")}),
>>     public String execute() throws Exception {...}
>>
>>
>>     /***************************************************************
>> **********************************/
>>     @Override
>>     @Action(value="/do/some/{**thing}", results={@Result(location =
>> "result.jsp")}),
>>     public String input() throws Exception {...}
>>
>>
>>
>> Now if the request contains myApp/do/some/specificstuff/**eat
>>
>>
>> which action will fire? I my case it's the input() method but it really
>> should be the execute()  method.
>> The parameter "thing" in the second annotation then equals
>> "specificstuff/eat"
>>
>>
>> Is it possible to control the "greediness" of the patternmatcher? Using
>> XML notation one could simply control
>> this behaviour by  reordering the<action>  tags.
>>
>> Thanks
>>
>> - Mounir
>>
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@struts.**apache.org<user-unsubscribe@struts.apache.org>
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>


-- 
Mounir Benzid
Systementwickler / EDV

meetingmasters.de
meetings meisterhaft managen

· Unabhängige Vermittlung von Tagungshotels
· Online-Hotelreservierungssystem zur Integration in die Veranstaltungs-Webseite
· Webbasiertes Veranstaltungs- und Teilnehmermanagement
· E-Procurement für den Tagungshoteleinkauf
· Webbasierte Anfrage und Verhandlung von Firmenraten

Max-Planck-Straße 22
D-54296 Trier

fon +49 (0)651-145789-38
fax +49 (0)651-145789-20

www.meetingmasters.de
mb@meetingmasters.de


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


Mime
View raw message