https://issues.apache.org/bugzilla/show_bug.cgi?id=50850

           Summary: Accepting java keyword in EL
           Product: Tomcat 7
           Version: 7.0.4
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Jasper
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: eldar.kama...@db.com
                CC: ysekharb...@gmail.com, joker8achtu...@googlemail.com
        Depends on: 49217


+++ This bug was initially created as a clone of Bug #49217 +++

Hi!

I am trying to use the following expression in my JSP page:

${exception.class.name}

And in response get this exception in tomcat:

Caused by: org.apache.jasper.JasperException:
/WEB-INF/views/uncaughtException.jspx(22,52) "${exception.class.name}" contains
invalid expression(s): javax.el.ELException: [class] is not a valid Java
identifier

It seems that the check for valid Java identifiers has been put there
intentionally, which is fine for checking validity of variables. However it
does not make any sense to apply the same check for property names as they
might well match reserved Java keywords, such as 'class', 'int', double', etc.
In the example above I am trying to get a value returned
java.lang.Exception#getClass(), which is not possible because of the check in
question.

According to bug #49217 it has been fixed in Tomcat 6.0.x but I still seem to
be getting the same problem in 7.0.4. 

Thanks,
Eldar

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

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

Reply via email to