luehe 2005/02/14 11:54:53 Modified: jasper2/src/share/org/apache/jasper Constants.java jasper2/src/share/org/apache/jasper/compiler TldLocationsCache.java Log: Use configuration from alt-dd if specified. (Setter for alt-dd had been added to StandardContext, but this info was never used.) Revision Changes Path 1.17 +3 -0 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Constants.java Index: Constants.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/Constants.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- Constants.java 17 Mar 2004 19:23:03 -0000 1.16 +++ Constants.java 14 Feb 2005 19:54:52 -0000 1.17 @@ -121,6 +121,9 @@ public static final String TMP_DIR = "javax.servlet.context.tempdir"; public static final String FORWARD_SEEN = "javax.servlet.forward.seen"; + // Must be kept in sync with org/apache/catalina/Globals.java + public static final String ALT_DD_ATTR = "org.apache.catalina.deploy.alt_dd"; + /** * Public Id and the Resource path (of the cached copy) * of the DTDs for tag library descriptors. 1.28 +28 -4 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TldLocationsCache.java Index: TldLocationsCache.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TldLocationsCache.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- TldLocationsCache.java 16 Jun 2004 18:05:12 -0000 1.27 +++ TldLocationsCache.java 14 Feb 2005 19:54:52 -0000 1.28 @@ -17,6 +17,8 @@ package org.apache.jasper.compiler; import java.io.InputStream; +import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.net.JarURLConnection; import java.net.URL; import java.net.URLClassLoader; @@ -34,6 +36,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.jasper.Constants; import org.apache.jasper.JasperException; import org.apache.jasper.xmlparser.ParserUtils; import org.apache.jasper.xmlparser.TreeNode; @@ -260,18 +263,39 @@ try { // Acquire input stream to web application deployment descriptor - is = ctxt.getResourceAsStream(WEB_XML); - if (is == null) { - if (log.isWarnEnabled()) { + String altDDName = (String)ctxt.getAttribute( + Constants.ALT_DD_ATTR); + if (altDDName != null) { + try { + is = new FileInputStream(altDDName); + } catch (FileNotFoundException e) { + if (log.isWarnEnabled()) { + log.warn(Localizer.getMessage( + "jsp.error.internal.filenotfound", + altDDName)); + } + } + } else { + is = ctxt.getResourceAsStream(WEB_XML); + if (is == null && log.isWarnEnabled()) { log.warn(Localizer.getMessage( "jsp.error.internal.filenotfound", WEB_XML)); } + } + + if (is == null) { return; } // Parse the web application deployment descriptor - TreeNode webtld = new ParserUtils().parseXMLDocument(WEB_XML, is); + TreeNode webtld = null; + // altDDName is the absolute path of the DD + if (altDDName != null) { + webtld = new ParserUtils().parseXMLDocument(altDDName, is); + } else { + webtld = new ParserUtils().parseXMLDocument(WEB_XML, is); + } // Allow taglib to be an element of the root or jsp-config (JSP2.0) TreeNode jspConfig = webtld.findChild("jsp-config");
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]