You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Dahnke, Eric (Company IT)" <Er...@morganstanley.com> on 2005/05/25 23:21:18 UTC

ModuleConfigImpl WAS: Parsing struts-config. Parser chokes on

Thanks for the response. It looks like it will work. I'm implementing it
as follows within an action, but the mci object doesn't get its
properties set. All the hashmaps of actions, and forwards, and
exceptions are always null.

ModuleConfigImpl mci = new ModuleConfigImpl("dashboard");
ActionConfig[] acs = mci.findActionConfigs();

for (int i=0;i<acs.length;i++) {
	System.out.println(acs[i].getPath());
} 

I'm not using modules, and the context name is dashboard. Has anyone
used this? Any ideas? Thx again.

> -----Original Message-----
> From: Michael Jouravlev [mailto:jmikus@gmail.com] 
> Sent: Wednesday, May 25, 2005 4:27 PM
> To: Struts Users Mailing List
> Subject: Re: Parsing struts-config. Parser chokes on <!DOCTYPE... >
> 
> 
> Have you tried 
> org.apache.struts.config.impl.ModuleConfigImpl.findActionConfigs
> ?
> 
> On 5/25/05, Dahnke, Eric (Company IT) 
> <Er...@morganstanley.com> wrote:
> > 
> > Hello,
> > 
> > I've written a little script to parse struts-config.xml in order to 
> > get a list of the actions and types, etc. It works great if 
> I comment 
> > out the <!DOCTYPE... > line at the top of the file.
> > 
> > Without commenting the <!DOCTYPE... > line I get an IOException 
> > related to a parse error when executing the following code:
> > 
> > DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
> >         dbf.setValidating(false);
> >       dbf.setIgnoringComments(true);
> > 
> >         try {
> >                 Document doc = dbf.newDocumentBuilder().parse(new
> > File(contextPath +
> >                     "/web/WEB-INF/struts-config.xml"));
> > 
> >         } catch ...
> > 
> > This is with JAXP using JDK 1.4.2. Can I comment out the 
> <!DOCTYPE... 
> > > line or otherwise get rid of it? Neither Struts nor 
> Tomcat seem to 
> > mind. The application starts and works fine. Thoughts? Workarounds? 
> > Thx.
> > --------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
--------------------------------------------------------
 
NOTICE: If received in error, please destroy and notify sender.  Sender does not waive confidentiality or privilege, and use is prohibited. 
 

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