title: How do I call java methods on an object from a FreeMarker template?
body: <p>Is it possible to call a method that takes parameters from a Freemarker template?</p>
  
  <p>I have an object model that I'm trying to render with Freemarker into a web page. One of the objects has a method to get a sublist of it's contents - taking a parameter that is used to filter the list:</p>
  
  <p><code>public List getunits(final String type);</code></p>
  
  <p>I know in JSP you can't do this directly, but you can write custom functions that will allow you to achieve the result you want. How do you solve this in Freemarker? Is it the same with writing custom functions? Or is there some way of actually calling this kind of function?</p>