Summary: | NoSuchElementException for attribute with empty string in custom tag | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | Hariprasad Manchi <hariprasad007> |
Component: | Jasper | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | trunk | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: |
patch for Validator.java
sample web application to see the exception. |
Description
Hariprasad Manchi
2014-05-15 16:33:45 UTC
Created attachment 31629 [details]
sample web application to see the exception.
Try to load the loginex.jsp. You will see the exception.
I have also attached a sample web application to reproduce the issue. Thanks for the report and the patch. This has been fixed in trunk for 8.0.7 and in 7.0.x for 7.0.54 onwards. Small correction: the fix is in 8.0.8 Hi, I had the similar issues with the custom tag, even in the fixed code. It looks like the issue is fixed only in the method “checkXmlAttributes”, but there is similar kind of the implementation even in the “getJspAttribute” method of validator class. I am not sure whether it is an intended implementation, but it is throwing the following exception during the JSP compilation. The application started working once we fix the code in “getJspAttribute” method Exception: java.util.NoSuchElementException at java.util.ArrayList$Itr.next(ArrayList.java:834) at org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1385) at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1262) at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:876) at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1538) Code snippets from “getJSPAttribute” 1380 if (el.containsEL()) { 1381 validateFunctions(el, n); 1382 } else { 1383 // Get text with \$ and \# escaping removed. 1384 // Should be a single Text node 1385 value = ((ELNode.Text) el.iterator().next()) 1386 .getText(); 1387 el = null; 1388 } 1389 } Request you to please look into this. Thanks Santhakumar (In reply to rsanthakumar from comment #5) > Hi, > > I had the similar issues with the custom tag, even in the fixed code. It > looks like the issue is fixed only in the method “checkXmlAttributes”, but > there is similar kind of the implementation even in the “getJspAttribute” > method of validator class. > This has been reported with bug 56561. The fix will be available in 6.0.42, 7.0.55 and 8.0.9 Can anyone identify which version the bug was introduced in pls. Found a 7.0.50 server to test on. It's not broken in that version if that helps anyone. |