|
From: Darren D. <da...@da...> - 2004-03-03 12:18:23
|
> Are you still using the FreemarkerServlet ? no, the MVC part includes FreemarkerView with similar semantics to VelocityView whereby it is able to retrieve a freemarker.template.Configuration object at initialization. > my requirements for Configuration are pretty simple at the moment, > within a subclass of FreemarkerServlet : > > createConfiguration() - I run configuration.setSharedVariable a few > times to add > - converter utils > - formatter utils > - money utils > - an ognl tool > - an enum template model (to allow me to access hibernate > persistent string enums) I'll look into this a little closer. setSharedVariable() and it's cousin setSetting() (??) are examples of the quirky configuration in FM. I've sent mail to one of the FM developers to see if they're amenable to streamlining their API slightly. > protected boolean preTemplateProcess( > HttpServletRequest request, > HttpServletResponse response, > Template template, > TemplateModel templateModel) > - I add some request scoped components > - browser identifyer tool > - url generating tool like the velocity link tool (depends > on request) > - toolbox - custom url generation for things like actions, > jsessionid encoding, http/https changing etc.. I guess these could be added to the Spring model Map in your controller code (possibly as reference data or even via an Interceptor) ? > I also use freemarker for generation of emails, without using the > freemarker servlet > > To do this I just add some beans into a map (the toolbox and other > utils above) and call template.process(nmap, stringWriter); similar will be available through the non-servlet ui components (again, see the Spring-Velocity javadocs) > I am keen to look at the code that you have prepared, especially > since it will be added into spring after 1.0 final. > Can you sent it to me ? yes, but give me a couple of days :) Thanks for the input. --=20 Darren Davison Public Key: http://www.davison.uk.net/key.jsp |