I have an ArrayList in my mvc controller class:
List<Market> markets = loadMarkets();
I add this list to Model object:
model.addAttribute("markets", markets);
In my template, when I want to get size() of this array:
<span>Top <strong th:text="${markets.size}"></strong>assets.</span>
I got this error:
Cannot evaluate because of compilation error(s): The method size() is undefined for the type Object.
Snapshot of the VSCode debugging tools:
I am using Spring Boot version 2.2.6.RELEASE with Thymeleaf template engine.