Bug 50850 - Accepting java keyword in EL
Summary: Accepting java keyword in EL
Status: RESOLVED DUPLICATE of bug 49217
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 7.0.4
Hardware: PC Windows XP
: P2 minor (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-01 12:53 UTC by eldar.kamalov
Modified: 2011-03-02 08:33 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description eldar.kamalov 2011-03-01 12:53:23 UTC
+++ 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
Comment 1 Konstantin Kolinko 2011-03-01 13:36:54 UTC
1. Support questions should be sent to the users@ list. Bugzilla is the wrong place for them.
2. You are free to use ${exception['class'].name} and so on.

*** This bug has been marked as a duplicate of bug 49217 ***
Comment 2 Mark Thomas 2011-03-02 08:33:09 UTC
"Depends on" updates are getting annoying