问题
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