1 23 24 29 30 package com.sun.enterprise.tools.guiframework.view; 31 32 import com.iplanet.jato.RequestManager; 33 34 import java.io.InputStream ; 35 import org.xml.sax.EntityResolver ; 36 import org.xml.sax.InputSource ; 37 import java.io.File ; 38 import javax.servlet.ServletContext ; 39 40 45 46 public class ViewXMLEntityResolver implements EntityResolver { 47 public InputSource resolveEntity (String publicId, String systemId) { 48 if (systemId != null && (systemId.endsWith(".xml") || systemId.endsWith(".dtd"))) { 49 58 if (systemId.startsWith("file:///")) { 59 systemId = systemId.substring(8); } 61 InputStream resourceStream = getClass().getClassLoader().getResourceAsStream(systemId); 62 if (resourceStream != null) { 63 return new InputSource (resourceStream); 64 } 65 } 66 return null; 68 } 69 } | Popular Tags |