1

How to calculate list size in velocity template? I am using velocity 1.4.

List<String> list = new ArrayList<String>();
peterh
  • 11,875
  • 18
  • 85
  • 108
Ananda Tapare
  • 53
  • 2
  • 4
  • `list.size()`? https://docs.oracle.com/javase/7/docs/api/java/util/List.html If that's not what you mean then you'll have to provide more detail. – ADyson Jul 18 '17 at 10:40
  • THis is what you need :https://stackoverflow.com/questions/7747254/how-to-access-get-the-size-of-an-array-collection-in-velocity-templates – soorapadman Jul 18 '17 at 11:22

2 Answers2

3

I assume that you mean "how do you call java methods in in the velocity template" because the method you are looking for is on the "List" javadoc, already mentioned.

I believe this article would be helpful:

How to access/get the size of an array/collection in velocity templates?

To save you a read, you should just be able to input this:

${myArrayList.size()}

TrigonDark
  • 184
  • 2
  • 9
-1

list.size() "Return with list size value Datatype 'Integer'"

Hijack
  • 1
  • 4