Class FreemarkerMvcFeature
- java.lang.Object
-
- org.glassfish.jersey.server.mvc.freemarker.FreemarkerMvcFeature
-
- All Implemented Interfaces:
Feature
@ConstrainedTo(SERVER) public final class FreemarkerMvcFeature extends Object implements Feature
Featureused to add support forMVCand Freemarker templates. Note: This feature also registersMvcFeature.- Author:
- Michal Gajdos, Jeff Wilde (jeff.wilde at complicatedrobot.com)
-
-
Field Summary
Fields Modifier and Type Field Description static StringCACHE_TEMPLATESIftruethen enable caching of Freemarker templates to avoid multiple compilation.static StringENCODINGProperty defines output encoding produced byTemplateProcessor.static StringTEMPLATE_BASE_PATHStringproperty defining the base path to Freemarker templates.static StringTEMPLATE_OBJECT_FACTORYProperty used to pass user-configuredFreemarkerConfigurationFactory.
-
Constructor Summary
Constructors Constructor Description FreemarkerMvcFeature()
-
-
-
Field Detail
-
TEMPLATE_BASE_PATH
public static final String TEMPLATE_BASE_PATH
Stringproperty defining the base path to Freemarker templates. If set, the value of the property is added in front of the template name defined in: Value can be absolute providing a full path to a system directory with templates or relative to currentservlet context. There is no default value. The name of the configuration property is "jersey.config.server.mvc.templateBasePath.freemarker".- See Also:
- Constant Field Values
-
CACHE_TEMPLATES
public static final String CACHE_TEMPLATES
Iftruethen enable caching of Freemarker templates to avoid multiple compilation. The default value isfalse. The name of the configuration property is "jersey.config.server.mvc.caching.freemarker".- Since:
- 2.5
- See Also:
- Constant Field Values
-
TEMPLATE_OBJECT_FACTORY
public static final String TEMPLATE_OBJECT_FACTORY
Property used to pass user-configuredFreemarkerConfigurationFactory. The default value is not set. The name of the configuration property is "jersey.config.server.mvc.factory.freemarker". This property will also accept an instance ofConfigurationdirectly, to support backwards compatibility. If you want to set customconfigurationthen settemplate loaderto multi loader of:WebappTemplateLoader(if applicable),ClassTemplateLoaderandFileTemplateLoaderkeep functionality of resolving templates. If no value is set, afactorywith the above behaviour is used by default in theFreemarkerViewProcessorclass.- Since:
- 2.5
- See Also:
- Constant Field Values
-
ENCODING
public static final String ENCODING
Property defines output encoding produced byTemplateProcessor. The value must be a valid encoding defined that can be passed to theCharset.forName(String)method. The default value isUTF-8. The name of the configuration property is "jersey.config.server.mvc.encoding.freemarker".- Since:
- 2.7
- See Also:
- Constant Field Values
-
-
Method Detail
-
configure
public boolean configure(FeatureContext context)
-
-