You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jorge Chacón Souto <jo...@mundo-r.com> on 2005/05/23 20:25:30 UTC
obtaining an action's ActionMapping
Hi.
Anybodoy knows how can I access the action B's ActionMapping from the
Action A (a preprocessing filter that is executed before every action) ?
I have to do that because I need to read the properties of many actions
in the filter, to check if the user can execute those actions.
I've tried the method
ConfigHelper.*getActionMapping*(java.lang.String path), but it returns
null because it's not implemented yet.
In Struts 1.0 there was a ActionServlet.findmapping method.
Thanks,
Jorge.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: obtaining an action's ActionMapping
Posted by Dakota Jack <da...@gmail.com>.
GOOD answer! Hope it is working for you now!
On 5/24/05, Jorge Chacón Souto <jo...@mundo-r.com> wrote:
> I changed it because the class ModuleUtils doesn't have a
> findActionConfig method:
>
> http://struts.apache.org/api/org/apache/struts/util/ModuleUtils.html
>
>
> Dakota Jack escribió:
>
> >Just do what he said. You changed it.
> >
> >On 5/24/05, Jorge Chacón Souto <jo...@mundo-r.com> wrote:
> >
> >
> >>I suppose that you refer to doing something like this:
> >>
> >>ModuleConfig module = ModuleUtils.getInstance().getModuleConfig(request);
> >>ActionMappingAplicacionWeb map = (ActionMappingAplicacionWeb)
> >>module.findActionConfig("FormularioCrearDocumento");
> >>
> >>It returns null, I don't know why.
> >>Any help?
> >>
> >>Thanks,
> >>Jorge.
> >>
> >>Hubert Rabago escribió:
> >>
> >>
> >>
> >>>Try ModuleUtils.getInstance().findActionConfig("actionB");
> >>>
> >>>Hubert
> >>>
> >>>On 5/23/05, Jorge Chacón Souto <jo...@mundo-r.com> wrote:
> >>>
> >>>
> >>>
> >>>
> >>>>Hi.
> >>>>
> >>>>Anybodoy knows how can I access the action B's ActionMapping from the
> >>>>Action A (a preprocessing filter that is executed before every action) ?
> >>>>I have to do that because I need to read the properties of many actions
> >>>>in the filter, to check if the user can execute those actions.
> >>>>I've tried the method
> >>>>ConfigHelper.*getActionMapping*(java.lang.String path), but it returns
> >>>>null because it's not implemented yet.
> >>>>In Struts 1.0 there was a ActionServlet.findmapping method.
> >>>>
> >>>>Thanks,
> >>>>Jorge.
> >>>>
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>>For additional commands, e-mail: user-help@struts.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>For additional commands, e-mail: user-help@struts.apache.org
> >>>
> >>>
> >>>
> >>>
> >>>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >>
> >>
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: obtaining an action's ActionMapping
Posted by Jorge Chacón Souto <jo...@mundo-r.com>.
Thanks!
I wasn't typing the action path correctly
Jorge
Hubert Rabago escribió:
>If it's returning null, make sure that (1) the request you're passing
>for the same module, and (2) you typed your action path correctly.
>The parameter should match the path of the action mapping you're
>looking for:
>
> <action-mappings>
> <action path="/myAction" .../>
> ...
> </action-mappings>
>
>ModuleUtils.getInstance().getModuleConfig(request).findActionConfig("/myAction");
>
>
>hth,
>Hubert
>
>
>On 5/24/05, Jorge Chacón Souto <jo...@mundo-r.com> wrote:
>
>
>>I changed it because the class ModuleUtils doesn't have a
>>findActionConfig method:
>>
>>http://struts.apache.org/api/org/apache/struts/util/ModuleUtils.html
>>
>>
>>Dakota Jack escribió:
>>
>>
>>
>>>Just do what he said. You changed it.
>>>
>>>On 5/24/05, Jorge Chacón Souto <jo...@mundo-r.com> wrote:
>>>
>>>
>>>
>>>
>>>>I suppose that you refer to doing something like this:
>>>>
>>>>ModuleConfig module = ModuleUtils.getInstance().getModuleConfig(request);
>>>>ActionMappingAplicacionWeb map = (ActionMappingAplicacionWeb)
>>>>module.findActionConfig("FormularioCrearDocumento");
>>>>
>>>>It returns null, I don't know why.
>>>>Any help?
>>>>
>>>>Thanks,
>>>>Jorge.
>>>>
>>>>Hubert Rabago escribió:
>>>>
>>>>
>>>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: obtaining an action's ActionMapping
Posted by Hubert Rabago <hr...@gmail.com>.
If it's returning null, make sure that (1) the request you're passing
for the same module, and (2) you typed your action path correctly.
The parameter should match the path of the action mapping you're
looking for:
<action-mappings>
<action path="/myAction" .../>
...
</action-mappings>
ModuleUtils.getInstance().getModuleConfig(request).findActionConfig("/myAction");
hth,
Hubert
On 5/24/05, Jorge Chacón Souto <jo...@mundo-r.com> wrote:
> I changed it because the class ModuleUtils doesn't have a
> findActionConfig method:
>
> http://struts.apache.org/api/org/apache/struts/util/ModuleUtils.html
>
>
> Dakota Jack escribió:
>
> >Just do what he said. You changed it.
> >
> >On 5/24/05, Jorge Chacón Souto <jo...@mundo-r.com> wrote:
> >
> >
> >>I suppose that you refer to doing something like this:
> >>
> >>ModuleConfig module = ModuleUtils.getInstance().getModuleConfig(request);
> >>ActionMappingAplicacionWeb map = (ActionMappingAplicacionWeb)
> >>module.findActionConfig("FormularioCrearDocumento");
> >>
> >>It returns null, I don't know why.
> >>Any help?
> >>
> >>Thanks,
> >>Jorge.
> >>
> >>Hubert Rabago escribió:
> >>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: obtaining an action's ActionMapping
Posted by Jorge Chacón Souto <jo...@mundo-r.com>.
I changed it because the class ModuleUtils doesn't have a
findActionConfig method:
http://struts.apache.org/api/org/apache/struts/util/ModuleUtils.html
Dakota Jack escribió:
>Just do what he said. You changed it.
>
>On 5/24/05, Jorge Chacón Souto <jo...@mundo-r.com> wrote:
>
>
>>I suppose that you refer to doing something like this:
>>
>>ModuleConfig module = ModuleUtils.getInstance().getModuleConfig(request);
>>ActionMappingAplicacionWeb map = (ActionMappingAplicacionWeb)
>>module.findActionConfig("FormularioCrearDocumento");
>>
>>It returns null, I don't know why.
>>Any help?
>>
>>Thanks,
>>Jorge.
>>
>>Hubert Rabago escribió:
>>
>>
>>
>>>Try ModuleUtils.getInstance().findActionConfig("actionB");
>>>
>>>Hubert
>>>
>>>On 5/23/05, Jorge Chacón Souto <jo...@mundo-r.com> wrote:
>>>
>>>
>>>
>>>
>>>>Hi.
>>>>
>>>>Anybodoy knows how can I access the action B's ActionMapping from the
>>>>Action A (a preprocessing filter that is executed before every action) ?
>>>>I have to do that because I need to read the properties of many actions
>>>>in the filter, to check if the user can execute those actions.
>>>>I've tried the method
>>>>ConfigHelper.*getActionMapping*(java.lang.String path), but it returns
>>>>null because it's not implemented yet.
>>>>In Struts 1.0 there was a ActionServlet.findmapping method.
>>>>
>>>>Thanks,
>>>>Jorge.
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>>
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: obtaining an action's ActionMapping
Posted by Dakota Jack <da...@gmail.com>.
Just do what he said. You changed it.
On 5/24/05, Jorge Chacón Souto <jo...@mundo-r.com> wrote:
> I suppose that you refer to doing something like this:
>
> ModuleConfig module = ModuleUtils.getInstance().getModuleConfig(request);
> ActionMappingAplicacionWeb map = (ActionMappingAplicacionWeb)
> module.findActionConfig("FormularioCrearDocumento");
>
> It returns null, I don't know why.
> Any help?
>
> Thanks,
> Jorge.
>
> Hubert Rabago escribió:
>
> >Try ModuleUtils.getInstance().findActionConfig("actionB");
> >
> >Hubert
> >
> >On 5/23/05, Jorge Chacón Souto <jo...@mundo-r.com> wrote:
> >
> >
> >>Hi.
> >>
> >>Anybodoy knows how can I access the action B's ActionMapping from the
> >>Action A (a preprocessing filter that is executed before every action) ?
> >>I have to do that because I need to read the properties of many actions
> >>in the filter, to check if the user can execute those actions.
> >>I've tried the method
> >>ConfigHelper.*getActionMapping*(java.lang.String path), but it returns
> >>null because it's not implemented yet.
> >>In Struts 1.0 there was a ActionServlet.findmapping method.
> >>
> >>Thanks,
> >>Jorge.
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >>
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: obtaining an action's ActionMapping
Posted by Jorge Chacón Souto <jo...@mundo-r.com>.
I suppose that you refer to doing something like this:
ModuleConfig module = ModuleUtils.getInstance().getModuleConfig(request);
ActionMappingAplicacionWeb map = (ActionMappingAplicacionWeb)
module.findActionConfig("FormularioCrearDocumento");
It returns null, I don't know why.
Any help?
Thanks,
Jorge.
Hubert Rabago escribió:
>Try ModuleUtils.getInstance().findActionConfig("actionB");
>
>Hubert
>
>On 5/23/05, Jorge Chacón Souto <jo...@mundo-r.com> wrote:
>
>
>>Hi.
>>
>>Anybodoy knows how can I access the action B's ActionMapping from the
>>Action A (a preprocessing filter that is executed before every action) ?
>>I have to do that because I need to read the properties of many actions
>>in the filter, to check if the user can execute those actions.
>>I've tried the method
>>ConfigHelper.*getActionMapping*(java.lang.String path), but it returns
>>null because it's not implemented yet.
>>In Struts 1.0 there was a ActionServlet.findmapping method.
>>
>>Thanks,
>>Jorge.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: obtaining an action's ActionMapping
Posted by Hubert Rabago <hr...@gmail.com>.
Try ModuleUtils.getInstance().findActionConfig("actionB");
Hubert
On 5/23/05, Jorge Chacón Souto <jo...@mundo-r.com> wrote:
> Hi.
>
> Anybodoy knows how can I access the action B's ActionMapping from the
> Action A (a preprocessing filter that is executed before every action) ?
> I have to do that because I need to read the properties of many actions
> in the filter, to check if the user can execute those actions.
> I've tried the method
> ConfigHelper.*getActionMapping*(java.lang.String path), but it returns
> null because it's not implemented yet.
> In Struts 1.0 there was a ActionServlet.findmapping method.
>
> Thanks,
> Jorge.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org