开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜