tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1002274 - in /tomcat/trunk: java/org/apache/jasper/compiler/ webapps/docs/
Date Tue, 28 Sep 2010 17:23:05 GMT
Author: markt
Date: Tue Sep 28 17:23:05 2010
New Revision: 1002274

URL: http://svn.apache.org/viewvc?rev=1002274&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49665
Better handling for missing TLD files. Report JSP filename and location.

Modified:
    tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
    tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java
    tomcat/trunk/java/org/apache/jasper/compiler/Parser.java
    tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Generator.java?rev=1002274&r1=1002273&r2=1002274&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Generator.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Generator.java Tue Sep 28 17:23:05 2010
@@ -1079,8 +1079,10 @@ class Generator {
                         + property
                         + "\")));");
             } else {
-                StringBuilder msg =
-                    new StringBuilder("jsp:getProperty for bean with name '");
+                StringBuilder msg = new StringBuilder();
+                msg.append("file:");
+                msg.append(n.getStart());
+                msg.append(" jsp:getProperty for bean with name '");
                 msg.append(name);
                 msg.append(
                         "'. Name was not previously introduced as per JSP.5.3");

Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java?rev=1002274&r1=1002273&r2=1002274&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/JspDocumentParser.java Tue Sep 28 17:23:05
2010
@@ -1290,7 +1290,8 @@ class JspDocumentParser
                             prefix,
                             uri,
                             location,
-                            err);
+                            err,
+                            null);
                     if (ctxt.getOptions().isCaching()) {
                         ctxt.getOptions().getCache().put(uri, result);
                     }

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Parser.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Parser.java?rev=1002274&r1=1002273&r2=1002274&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/Parser.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/Parser.java Tue Sep 28 17:23:05 2010
@@ -385,7 +385,8 @@ class Parser implements TagConstants {
                     if (impl == null) {
                         TldLocation location = ctxt.getTldLocation(uri);
                         impl = new TagLibraryInfoImpl(ctxt, parserController,
-                                pageInfo, prefix, uri, location, err);
+                                pageInfo, prefix, uri, location, err,
+                                reader.mark());
                         if (ctxt.getOptions().isCaching()) {
                             ctxt.getOptions().getCache().put(uri, impl);
                         }

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=1002274&r1=1002273&r2=1002274&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java Tue Sep 28 17:23:05
2010
@@ -134,8 +134,9 @@ class TagLibraryInfoImpl extends TagLibr
     /**
      * Constructor.
      */
-    public TagLibraryInfoImpl(JspCompilationContext ctxt, ParserController pc, PageInfo pi,
-            String prefix, String uriIn, TldLocation location, ErrorDispatcher err)
+    public TagLibraryInfoImpl(JspCompilationContext ctxt, ParserController pc,
+            PageInfo pi, String prefix, String uriIn, TldLocation location,
+            ErrorDispatcher err, Mark mark)
             throws JasperException {
         super(prefix, uriIn);
 
@@ -162,7 +163,7 @@ class TagLibraryInfoImpl extends TagLibr
                         throw new FileNotFoundException(tldName);
                     }
                 } catch (FileNotFoundException ex) {
-                    err.jspError("jsp.error.file.not.found", tldName);
+                    err.jspError(mark, "jsp.error.file.not.found", tldName);
                 }
 
                 parseTLD(tldName, in, null);
@@ -177,7 +178,7 @@ class TagLibraryInfoImpl extends TagLibr
                     in = jarResource.getEntry(tldName).openStream();
                     parseTLD(jarResource.getUrl(), in, jarResource);
                 } catch (Exception ex) {
-                    err.jspError("jsp.error.tld.unable_to_read", jarResource.getUrl(),
+                    err.jspError(mark, "jsp.error.tld.unable_to_read", jarResource.getUrl(),
                             jarResource.getUrl(), ex.toString());
                 }
             }

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1002274&r1=1002273&r2=1002274&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Tue Sep 28 17:23:05 2010
@@ -212,6 +212,11 @@
   <subsection name="Jasper">
     <changelog>
       <fix>
+        <bug>49665</bug>: Provide better information including JSP file name
and
+        location when a missing file is detected during TLD handling. Patch
+        provided by Ted Leung. (markt)
+      </fix>
+      <fix>
         <bug>49726</bug>: Specifying a default content type via a JSP property
         group should not prevent a page from setting some other content type.
         (markt)



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message