开发者

Is it possible to detect java class type using El with JSTL?

开发者 https://www.devze.com 2023-02-09 14:29 出处:网络
code is like this: <c:forEachitems=\"${itemList}\" var=\"item\"> //do stuff based on the class type of item

code is like this:

 <c:forEach  items="${itemList}" var="item">
 //do stuff based on the class type of item                                 
 </c:forEach>

Is it possible to 开发者_如何学运维do that? Thanks!


Yes, ${item.class} conforms to the javabeans convention, so you get the Class. Then you can get other properties.

If it doesn't work, use ${item['class']}

0

精彩评论

暂无评论...
验证码 换一张
取 消