views:

29

answers:

1

From my controller I set my Model and view like:

ModelAndView mav = new ModelAndView();

mav.setView("index");

mav.addObject("user", user);
mav.addObject("someCollection", someCollection);

return mav;

Now I want to create a helper type object that will take the someCollection and the user object as parameters.

My helper function will output some HTML etc., is this possible?

+1  A: 

You can write macros and directives using FTL or Java, expose them to your templates and invoke them same way you normally do with built-in macros/directives.

Vicente Reig