Class FreeMarkerViewResolver

All Implemented Interfaces:
Aware, ApplicationContextAware, Ordered, ServletContextAware, ViewResolver

public class FreeMarkerViewResolver extends AbstractTemplateViewResolver
Convenience subclass of 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 for details.

Note: To ensure that the correct encoding is used when the rendering the response, set the content type with an appropriate charset attribute — for example, "text/html;charset=UTF-8"; however, as of Spring Framework 6.2, it is no longer strictly necessary to explicitly set the content type in the FreeMarkerViewResolver if you have set an explicit encoding via either FreeMarkerView.setEncoding(String), FreeMarkerConfigurationFactory.setDefaultEncoding(String), or Configuration.setDefaultEncoding(String).

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.

Note: Spring's FreeMarker support requires FreeMarker 2.3.33 or higher.

Since:
1.1
Author:
Juergen Hoeller, Sam Brannen
See Also: