expression language: quick way to get maximum of a collection

天大地大妈咪最大 提交于 2019-12-13 01:46:58

问题


Is there some tag or function that allows to get the maximum value of a collection?

I konw I can do a for loop for that, but a one liner would be better.


回答1:


I don't think you can do that with jstl or el.

The easiest is using forEach jstl tag.

The simple reason why there are no tags for finding the maximum value of a collection is because your collection could be anything. How would the jvm find the maximum value for a collections of "Student" objects.



来源:https://stackoverflow.com/questions/9479115/expression-language-quick-way-to-get-maximum-of-a-collection

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!