tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 50147] [static] is not a valid Java identifier
Date Fri, 13 May 2011 01:55:07 GMT

--- Comment #6 from Richard Kennard <> 2011-05-13 01:55:07
UTC ---
Hi guys,

Can I beg a little advice? I think this is the right place to ask because
others who encounter this bug may have the same question.

EL has always lacked some kind of 'instanceof' operator for determining the
type of an Object. In the past, a common workaround for this has been to do...

${ == 'com.myapp.Person'}


${foo.class.simpleName == 'Person'}

...these aren't the greatest from a type-safety point of view, but they are
quite readable and work fine. Note they are equivalent of writing (in Java):
new Foo().getClass()' not 'Foo.class' (ie. they are calling the getter, not
trying to use the Java keyword 'class')

However now that 'class' is a reserved word in EL because of (as mentioned

Identifier ::= Java language identifier

...such EL expressons fail to compile. What is the suggested alternative?



Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message