You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brantley Hobbs <bh...@itos.uga.edu> on 2006/03/22 21:38:19 UTC

Get a list of defined Struts actions at runtime

All,

At runtime I need to get a list of /all/ the actions that are defined in
Struts.  I'd rather not extract them directly from the conf file(s)
unless it's absolutely necessary, but I don't (readily) see an API for
doing this so I might be forced into it.

I do see that you can pattern match against an action name using
ActionConfigMatcher, but that only returns a single action and it
requires that you know the name of the action ahead of time.

Can anyone suggest something?

Thanks,
Brantley Hobbs

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


Re: Get a list of defined Struts actions at runtime

Posted by Antonio Petrelli <br...@tariffenet.it>.
Brantley Hobbs ha scritto:
> All,
>
> At runtime I need to get a list of /all/ the actions that are defined in
> Struts.  I'd rather not extract them directly from the conf file(s)
> unless it's absolutely necessary, but I don't (readily) see an API for
> doing this so I might be forced into it.
>   

It seems a bit difficult but... It seems that ModuleConfigImpl has a 
list of ActionConfig, that is what you need.
The problem is that only ActionServlet can access to ModuleConfig. But 
you have to subclass ModuleConfigImpl to get the actionConfigList field, 
because it seems that there is no getter method.
I hope this is a good hint.
Ciao
Antonio

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