You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2006/12/29 11:22:33 UTC

DO NOT REPLY [Bug 41257] New: - EL in dynamic attribute causes NPE in Tomcat 6

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


DO NOT REPLY [Bug 41257] - EL in dynamic attribute causes NPE in Tomcat 6

Posted by bu...@apache.org.
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





------- Additional Comments From funkman@joedog.org  2007-01-02 17:03 -------
*** Bug 41258 has been marked as a duplicate of this bug. ***

-- 
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


DO NOT REPLY [Bug 41257] - EL in dynamic attribute causes NPE in Tomcat 6

Posted by bu...@apache.org.
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





------- Additional Comments From lgalfaso@gmail.com  2007-10-25 21:37 -------
Created an attachment (id=21048)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=21048&action=view)
Fix for Bug 41258

I am not sure that bug 41257 and bug 41258 are the same issue, but I will trust
funkman as he knows more about Tomcat that what I do (and bug 41257 is not a
very clear description of the bug anyhow.)
  This patch fixes the issue raised by 41258, this is literal expressions that
make use of EL escape syntax within custom tag attributes values are not
unescaped.

-- 
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