|
From: <jue...@we...> - 2004-03-14 22:01:48
|
Darren, everybody, =20 I've significantly reworked out Velocity and FreeMarker support this = weekend: They are as analogous as possible now, and a bit more powerful. = For example, the Velocity resource loader respectively FreeMarker = template loader support is far more sophisticated now, being able to = resolve classpath resources and resources in WARs that are not expanded. =20 One thing that I've removed is the default config location = "/WEB-INF/velocity.properties". This is not something we do not = recommend, and the fallback was somewhat awkward (just if none of the = other properties was set, not even "resourceLoaderPath"). I've recently = removed such a fallback from LocalSessionFactoryBean too. If anyone = wants to use a separate config file, a custom "configLocation" value is = the way to go. =20 FreemarkerConfigurationFactory and FreemarkerView are implemented in a = somewhat different way now. There were a couple of synchronization = issues before: A FreeMarker Configuration object is *not* synchronized, = so we must not use the default Configuration instance for multiple = factories, and we must not modify a Configuration instance in = FreemarkerView objects. All of the shared setup happens in = FreemarkerConfigurationFactory now. =20 FreemarkerConfigurationFactory has a "templateLoaderPath" property now, = analogous to VelocityEngineFactory's "resourceLoaderPath". = FreemarkerView specifies the URL within that path, just like = VelocityView. In contrast to VelocityView, it does not offer to cache = the template in the View object, as we always need to render the = FreeMarker template for the current locale (FreeMarker expressions are = locale-aware). =20 Juergen =20 |