when trying to access a getClass() method within a jsp, the following exception occurs: org.apache.jasper.JasperException: /jsp/example.jsp(68,6) "${memBean.class.name == text}" contains invalid expression(s): javax.el.ELException: [class] is not a valid Java identifier is this a bug or a desired feature of 7.0.2? as far as i've noticed, the validation is done in org.pache.el.util.Validation whereby invalidIdentifiers contains the class keyword by the way, validation is done currently case-insensitive, so *.Class.Name would be a work-around
This is spec required behaviour. Further questions should be addressed to the users mailing list.
"class" is a reserved word in Java. Note, that you can write your expression as "${memBean['class'].name == text}"
*** Bug 50272 has been marked as a duplicate of this bug. ***
This is the breaking change for us to switch to Tomcat7. We have quite a big codebase to search for keyword usages in .jsp/.tag files. Is there a property/parameters/setting to enforce older behavior (like in 6.0) of jsp compiler?
The same fix has been / will be applied to Tomcat 6. In the short-term you can use org.apache.el.parser.SKIP_IDENTIFIER_CHECK to bypass the check but that is not a viable long term solution. As time consuming as it may be, you'll need to review your apps for illegal EL and fix any issues.
*** This bug has been marked as a duplicate of bug 49217 ***