如何实现“instanceOf”在JSTL [英] How to implement "instanceOf" in JSTL

查看:208
本文介绍了如何实现“instanceOf”在JSTL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

或者说获取类名或获取类型名称

or say get class name or get type name

以便可以在主要流行的Web容器/服务器上运行?

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

谢谢。

推荐答案

$ {foo.class.name} 返回完全合格的名称 foo

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

但是 instanceof 已经是你应该在设计良好的OO程序中很少使用的东西,它甚至应该被使用更少的JSP EL,其中方法是动态调用而不关心实际类型,最终目标应该只是生成标记。

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.

这篇关于如何实现“instanceOf”在JSTL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆