tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 50147] [static] is not a valid Java identifier
Date Fri, 13 May 2011 01:55:07 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=50147

--- Comment #6 from Richard Kennard <richard@kennardconsulting.com> 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...

${foo.class.name == 'com.myapp.Person'}

...or...

${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
above)...

Identifier ::= Java language identifier

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

Regards,

Richard.

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message