"Andrew Friebel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I am having trouble parsing a web.xml file using SAX. The war file will
> deploy with no hassles, however, I am writing a local program that will
> allow me to change the web.xml file locally before distribution.
>
>
>
> My problem is the DTD definition in the web.xml file. I require the DTD
> file definition, yet when I try and parse the file with the DTD
> definition,
> I keep getting a connection timeout error. When I remove the DTD
> definition, the file is parsed with no issues.
>
>
You are a bit sparse on details for how you are doing this and versions, but
assuming that you are using SAX, you need to set and EntityResolver that
does something like (for 5.5):
public ImputSource resolveEntity(String pubid, String sysid) throws
IOException{
if("-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN".equals(pubid)) {
InputStream is =
getClassloader().getResourceAsStream("/javax/servlet/resources/web-app_2_3.dtd");
return new InputSource(is);
}
return null;
}
>
> How do I get around the timeout issue when parsing the web.xml file with
> the
> DTD definition?
>
>
>
> The DTD definition is:
>
>
>
> <!DOCTYPE web-app
>
> PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
>
> "http://java.sun.com/dtd/web-app_2_3.dtd">
>
>
>
> Regards,
>
> Andrew
>
>
---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]