You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by p <ll...@dowman.net> on 2003/07/21 16:45:48 UTC
getting an ActionMapping class from within a custom tag
Hi,
What: I would like to find the roles associated with an ActionMapping
from within a custom tag, but I only have the action name so I guess I
need to get an instance of the ActionMapping class. How can I do this?
How do I get an ActionMapping class, given the name of the action?
Why: I want a generalized way to hide links to actions that the
currently logged-in user doesn't have access to. So what I plan to do
is subclass the html:link tag-- my subclass will check the current
user's access to the action for the specified link, and either hide it,
or print only the link text.
Thanks in advance.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: getting an ActionMapping class from within a custom tag
Posted by Alex Shneyderman <al...@law.columbia.edu>.
> -----Original Message-----
> From: p [mailto:ll@dowman.net]
> Sent: Monday, July 21, 2003 10:46 AM
> To: struts-user@jakarta.apache.org
> Subject: getting an ActionMapping class from within a custom tag
>
> Hi,
>
> What: I would like to find the roles associated with an ActionMapping
> from within a custom tag, but I only have the action name so I guess I
> need to get an instance of the ActionMapping class. How can I do this?
> How do I get an ActionMapping class, given the name of the action?
ModuleConfig mc = RequestUtils.getRequestModuleConfig (request);
ActionMapping am = (ActionMapping) mc.findActionConfig (actionName);
> Why: I want a generalized way to hide links to actions that the
> currently logged-in user doesn't have access to. So what I plan to do
> is subclass the html:link tag-- my subclass will check the current
> user's access to the action for the specified link, and either hide
it,
> or print only the link text.
You can do it easier with tiles I think.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org