I have a Page
class implementing java.util.Collection
as well as other methods like hasPreviousPage
, getTotalPages
, etc. Freemarker wraps this class in a SimpleSequence
, preventing me to access such methods.
i.e. when I write ${page.getTotalPages()}
I got this error:
Expected hash. myPage evaluated instead to freemarker.template.SimpleSequence [...]
How can I tell Freemarker to expose those methods? (Ideally I would like to be able to access those custom methods without loosing "Collection" identity, so I can keep <#list page as item> )
Thanks for any suggestion/reference.