Well, I knew if I looked hard enough I would find it and I did! Beat yas all to the draw
Anyway, it looks like the web server (at least
Tomcat) provides a jndi key to the struts-config file. So, to get a reference to struts-config that you can read and parse, you can do this:
strutsConfigFile = servlet.getServletContext().getResource( "/WEB-INF/struts-config.xml" ).toString();
This returns you something like :
jndi: localhost/[your_application_name]/WEB-INF/struts-config.xml
The trick is that you meed to know the resource name is WEB-INF/struts-config.xml (I looked at the source for ActionServlet and viola - there it was! )
So anyway, using something like JDOM (which BTW is a pretty nice XML parser) you can do something like:
SAXBuilder builder = new SAXBuilder();
strutsConfigFile = servlet.getServletContext().getResource( "/WEB-INF/struts-config.xml" ).toString();
Document strutsDocument = builder.build(strutsConfigFile);
and just use the nice features of JDOM to parse out whatcha need from there.
Ok, hope this was helpful for yuse as it was for me!