open class FreeMarkerConfigurer : FreeMarkerConfigurationFactory, FreeMarkerConfig, InitializingBean, ResourceLoaderAware, ServletContextAware
JavaBean to configure FreeMarker for web usage, via the "configLocation" and/or "freemarkerSettings" and/or "templateLoaderPath" properties. The simplest way to use this class is to specify just a "templateLoaderPath"; you do not need any further configuration then. This bean must be included in the application context of any application using Spring's FreeMarkerView for web MVC. It exists purely to configure FreeMarker. It is not meant to be referenced by application components but just internally by FreeMarkerView. Implements FreeMarkerConfig to be found by FreeMarkerView without depending on the bean name the configurer. Each DispatcherServlet can define its own FreeMarkerConfigurer if desired.
Note that you can also refer to a preconfigured FreeMarker Configuration instance, for example one set up by FreeMarkerConfigurationFactoryBean, via the "configuration" property. This allows to share a FreeMarker Configuration for web and email usage, for example. This configurer registers a template loader for this package, allowing to reference the "spring.ftl" macro library (contained in this package and thus in spring.jar) like this: Note: Spring's FreeMarker support requires FreeMarker 2.3 or higher.
|
|
open class FreeMarkerViewResolver : AbstractTemplateViewResolver
Convenience subclass of org.springframework.web.servlet.view.UrlBasedViewResolver that supports FreeMarkerView (i.e. FreeMarker templates) and custom subclasses of it. The view class for all views generated by this resolver can be specified via the "viewClass" property. See UrlBasedViewResolver's javadoc for details. Note: When chaining ViewResolvers, a FreeMarkerViewResolver will check for the existence of the specified template resources and only return a non-null View object if the template was actually found. |