You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Galia Angelova <ga...@yahoo.com> on 2008/02/13 12:08:33 UTC
action mapping - how can I map ALL incoming urls to one action?
Hallo everybody,
I use struts version 2.0.11 with spring 2.0.5.
I need to map all incomming urls to one and the same action.
This action works like a dispatcher - acctording to some data taken from the data base, decides where to redirect the request.
I''ll appreciate any ideas!
Thanks!
---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.
Re: action mapping - how can I map ALL incoming urls to one action?
Posted by Laurie Harper <la...@holoweb.net>.
That's probably the best approach if you want to map incoming requests
to different actions based on custom logic. If you really just want to
have every request handled by the same action, you can just use a
wildcard action mapping (name="/*") to achieve that with less configuration.
L.
Galia Angelova wrote:
> Thank you, Piero!
>
> The problem with the interseptors is that they come after the ServletDispatcher. That means that i get an exception before I get to the interseptors, because the mapping was not found :)
>
> I think I have found a solution - custom ActionMapper. I extended the DefaultActionMapper and override the method getMapping().
> Then specified the full class name of my custom mapper in struts.properties.
>
> Greetings!
>
> Piero Sartini <li...@pierosartini.de> wrote: > I need to map all incomming urls to one and the same action.
>> This action works like a dispatcher - acctording to some data taken from
>> the data base, decides where to redirect the request.
>>
>> I''ll appreciate any ideas!
>
> I think an Interceptor would be a better solution for this:
> http://struts.apache.org/2.x/docs/interceptors.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
> ---------------------------------
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: action mapping - how can I map ALL incoming urls to one action?
Posted by Galia Angelova <ga...@yahoo.com>.
Thank you, Piero!
The problem with the interseptors is that they come after the ServletDispatcher. That means that i get an exception before I get to the interseptors, because the mapping was not found :)
I think I have found a solution - custom ActionMapper. I extended the DefaultActionMapper and override the method getMapping().
Then specified the full class name of my custom mapper in struts.properties.
Greetings!
Piero Sartini <li...@pierosartini.de> wrote: > I need to map all incomming urls to one and the same action.
>
> This action works like a dispatcher - acctording to some data taken from
> the data base, decides where to redirect the request.
>
> I''ll appreciate any ideas!
I think an Interceptor would be a better solution for this:
http://struts.apache.org/2.x/docs/interceptors.html
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
Re: action mapping - how can I map ALL incoming urls to one action?
Posted by Piero Sartini <li...@pierosartini.de>.
> I need to map all incomming urls to one and the same action.
>
> This action works like a dispatcher - acctording to some data taken from
> the data base, decides where to redirect the request.
>
> I''ll appreciate any ideas!
I think an Interceptor would be a better solution for this:
http://struts.apache.org/2.x/docs/interceptors.html
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org