tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 41257] New: - EL in dynamic attribute causes NPE in Tomcat 6
Date Fri, 29 Dec 2006 10:22:33 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41257>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41257

           Summary: EL in dynamic attribute causes NPE in Tomcat 6
           Product: Tomcat 6
           Version: 6.0.7
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: arjan.tijms@mbuyu.nl


Whenever I try to use any EL (either $ or # syntax) in a taglib tag's dynamic
attribute in Tomcat 6.0.7, I get the following exception:

java.lang.NullPointerException
   at
org.apache.jasper.compiler.Generator$GenerateVisitor.evaluateAttribute(Generator.java:2777)
   at
org.apache.jasper.compiler.Generator$GenerateVisitor.generateSetters(Generator.java:2988)
   at
org.apache.jasper.compiler.Generator$GenerateVisitor.generateCustomStart(Generator.java:2169)
   at
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1689)
   at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
   at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
   at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
   at
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1705)
   at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
   at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)

I traced into the source code of Tomcat 6.0.7 with a debugger and found out the
exception is caused by the code at the mentioned line 2777 of Generator.java,
which is trying to request a TagAttributeInfo from the current attribute, but
for a dynamic attribute the JspAttribute.tai field is always null.

When I debug the evaluateAttribute method in question, I see that for
Node.JspAttribute attr, the "dynamic" field (attr.dynamic) is correctly set to 
true and attr.getLocalName() returns the correct name of the dynamic attribute.
At line 2771 attr.isELInterpreterInput() returns true, since attr.el != null.
When I inspect attr.el, I see the EL expresion is correctly parsed. Only, a few
lines below that the code fails with the NPE upon accessing the TagAttributeInfo
object tai (which is, as said always null for dynamic attributes).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message