Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement "instanceOf" in JSTL

Tags:

java

jsp

jstl

or say get class name or get type name

so that can work on major popular web container/servers?

Thank you.

like image 880
Dreamer Avatar asked Jul 05 '12 16:07

Dreamer


1 Answers

${foo.class.name} returns the fully qualidied name of foo.

But instanceof being already something you should rarely use in a well-design OO program, it should be used even less in the JSP EL, where methods are called dynamically without caring of the actual type, and where the end goal should only be to generate markup.

like image 86
JB Nizet Avatar answered Sep 18 '22 19:09

JB Nizet