struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: list of modules
Date Thu, 29 Apr 2004 06:39:21 GMT
Aaron Smuts wrote:

>To just get a list you could do something like this, I guess:
>
>In an Action class put the getServlet, else omit if in the servlet. 
>
>Enumeration enum =
>getServlet().getServletConfig().getInitParameterNames()
>
>Then you could look for the ones that start with "config/"
>  
>
A more robust mechanism would be to iterate through all of the servlet 
context attributes, and check for "instanceof ModuleConfig".  Once you 
know that the object is indeed a ModuleConfig, you can cast it to that 
API, and do things like getPrefix() to find the corresponding module prefix.

>This doesn't tell you much.
>
>Aaron Smuts
>  
>
Craig




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


Mime
View raw message