1 package org.enhydra.server.util; 2 3 import java.io.InputStream ; 4 5 import org.xml.sax.InputSource ; 6 import org.xml.sax.SAXException ; 7 import org.xml.sax.helpers.DefaultHandler ; 8 9 17 18 public class WebXMLEntityResolver extends DefaultHandler { 20 21 private final String WebDtdPublicId_23 = 22 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"; 23 private final String WebDtdResourcePath_23 = 24 "/javax/servlet/resources/web-app_2_3.dtd"; 25 26 public WebXMLEntityResolver() { 27 } 28 29 public InputSource resolveEntity(String publicId, String systemId) throws SAXException { 30 if (publicId.equals(WebDtdPublicId_23)) { 31 InputStream dtdStream = this.getClass().getResourceAsStream(WebDtdResourcePath_23); 33 34 35 41 46 return new InputSource (dtdStream); 47 } else { 49 return null; 51 } 52 } 53 } | Popular Tags |