Author: remm Date: Mon May 9 15:45:09 2016 New Revision: 1742984 URL: http://svn.apache.org/viewvc?rev=1742984&view=rev Log: Fix NPEs with not found TLDs.
Modified: tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java tomcat/trunk/java/org/apache/jasper/compiler/TldCache.java tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java?rev=1742984&r1=1742983&r2=1742984&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java Mon May 9 15:45:09 2016 @@ -172,8 +172,16 @@ class TagLibraryInfoImpl extends TagLibr } // Get the representation of the TLD + System.out.println("tldResourcePath: " + tldResourcePath.getUrl()); + if (tldResourcePath.getUrl() == null) { + err.jspError("jsp.error.tld.missing", prefix, uri); + } TaglibXml taglibXml = ctxt.getOptions().getTldCache().getTaglibXml(tldResourcePath); + System.out.println("taglibXml: " + taglibXml); + if (taglibXml == null) { + err.jspError("jsp.error.tld.missing", prefix, uri); + } // Populate the TagLibraryInfo attributes this.jspversion = taglibXml.getJspVersion(); Modified: tomcat/trunk/java/org/apache/jasper/compiler/TldCache.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/TldCache.java?rev=1742984&r1=1742983&r2=1742984&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/compiler/TldCache.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/TldCache.java Mon May 9 15:45:09 2016 @@ -93,6 +93,9 @@ public class TldCache { public TaglibXml getTaglibXml(TldResourcePath tldResourcePath) throws JasperException { TaglibXmlCacheEntry cacheEntry = tldResourcePathTaglibXmlMap.get(tldResourcePath); + if (cacheEntry == null) { + return null; + } long lastModified[] = getLastModified(tldResourcePath); if (lastModified[0] != cacheEntry.getWebAppPathLastModified() || lastModified[1] != cacheEntry.getEntryLastModified()) { Modified: tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties?rev=1742984&r1=1742983&r2=1742984&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/jasper/resources/LocalStrings.properties Mon May 9 15:45:09 2016 @@ -140,6 +140,7 @@ jsp.error.file.not.found=File [{0}] not jsp.error.missing_attribute=According to the TLD or the tag file, attribute {0} is mandatory for tag {1} jsp.error.bad_attribute=Attribute {0} invalid for tag {1} according to TLD jsp.error.tld.unable_to_get_jar=Unable to get JAR resource \"{0}\" containing TLD: {1} +jsp.error.tld.missing=Unable to find taglib \"{0}\" for URI: {1} jsp.error.tld.missing_jar=Missing JAR resource \"{0}\" containing TLD jsp.error.unable.to_find_method=Unable to find setter method for attribute: {0} jsp.error.bad_tag=No tag \"{0}\" defined in tag library imported with prefix \"{1}\" Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1742984&r1=1742983&r2=1742984&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Mon May 9 15:45:09 2016 @@ -283,6 +283,9 @@ JAR has been exploded into <code>WEB-INF/classes</code> and the web application is deployed as a packed WAR. (markt) </fix> + <fix> + NPEs with not found TLDs. (remm) + </fix> </changelog> </subsection> <subsection name="WebSocket"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org