Configuration Reference

Version:1.3.2

Views Core Config Properties

🔗
Table 1. Configuration Properties for ViewsConfigurationProperties
Property Type Description

micronaut.views.enabled

boolean

Whether view rendering is enabled. Default value (true).

micronaut.views.folder

java.lang.String

The folder to look for views.

micronaut.views.dir

java.lang.String

The folder to look for views. Default value ("views").

🔗
Table 2. Configuration Properties for SecurityViewModelProcessorConfigurationProperties
Property Type Description

micronaut.security.views-model-decorator.enabled

boolean

Enable {@link SecurityViewModelProcessor}. Default value (true).

micronaut.security.views-model-decorator.security-key

java.lang.String

Model key name. Default value ("security").

micronaut.security.views-model-decorator.principal-name-key

java.lang.String

Nested security map key for the user’s name property. Default value ("name").

micronaut.security.views-model-decorator.attributes-key

java.lang.String

Nested security map key for the user’s attributes property. Default value ("attributes").

🔗
Table 3. Configuration Properties for CspConfiguration
Property Type Description

micronaut.views.csp.enabled

boolean

Sets whether CSP is enabled. Default false.

micronaut.views.csp.policy-directives

java.lang.String

Sets the policy directives.

micronaut.views.csp.report-only

boolean

If true, the Content-Security-Policy-Report-Only header will be sent instead of Content-Security-Policy. Default false.

micronaut.views.csp.generate-nonce

boolean

If true, the CSP header will contain a generated nonce that is made available to view renderers. The nonce should change for each request/response cycle and can be used by views to authorize inlined script blocks.

micronaut.views.csp.filter-path

java.lang.String

Sets the path the CSP filter should apply to. Default value "/**".

micronaut.views.csp.force-secure-random

boolean

Sets whether SecureRandom is forced for use in generated nonce values. Defaults to false. Enabling this requires careful consideration, because SecureRandom will block infinitely without enough entropy.

micronaut.views.csp.random-engine

java.util.Random

Sets the Random data engine used to generate nonce values. Ignored if forceSecureRandom is set to true.

Views Freemarker Config Properties

🔗
Table 4. Configuration Properties for FreemarkerViewsRendererConfigurationProperties
Property Type Description

micronaut.views.freemarker.enabled

boolean

Whether freemarker views are enabled.

micronaut.views.freemarker.default-extension

java.lang.String

Sets the default extension to use.

micronaut.views.freemarker.classic-compatible

boolean

micronaut.views.freemarker.classic-compatible-as-int

int

micronaut.views.freemarker.sqldate-and-time-time-zone

java.util.TimeZone

micronaut.views.freemarker.number-format

java.lang.String

micronaut.views.freemarker.custom-number-formats

java.util.Map

micronaut.views.freemarker.boolean-format

java.lang.String

micronaut.views.freemarker.time-format

java.lang.String

micronaut.views.freemarker.date-format

java.lang.String

micronaut.views.freemarker.date-time-format

java.lang.String

micronaut.views.freemarker.custom-date-formats

java.util.Map

micronaut.views.freemarker.arithmetic-engine

freemarker.core.ArithmeticEngine

micronaut.views.freemarker.output-encoding

java.lang.String

micronaut.views.freemarker.urlescaping-charset

java.lang.String

micronaut.views.freemarker.new-builtin-class-resolver

freemarker.core.TemplateClassResolver

micronaut.views.freemarker.auto-flush

boolean

micronaut.views.freemarker.show-error-tips

boolean

micronaut.views.freemarker.apibuiltin-enabled

boolean

micronaut.views.freemarker.lazy-imports

boolean

micronaut.views.freemarker.lazy-auto-imports

java.lang.Boolean

micronaut.views.freemarker.auto-imports

java.util.Map

micronaut.views.freemarker.auto-includes

java.util.List

micronaut.views.freemarker.strict-bean-models

boolean

micronaut.views.freemarker.settings

java.io.InputStream

micronaut.views.freemarker.template-loader

freemarker.cache.TemplateLoader

micronaut.views.freemarker.template-lookup-strategy

freemarker.cache.TemplateLookupStrategy

micronaut.views.freemarker.template-name-format

freemarker.cache.TemplateNameFormat

micronaut.views.freemarker.template-configurations

freemarker.cache.TemplateConfigurationFactory

micronaut.views.freemarker.cache-storage

freemarker.cache.CacheStorage

micronaut.views.freemarker.directory-for-template-loading

java.io.File

micronaut.views.freemarker.template-update-delay

int

micronaut.views.freemarker.template-update-delay-milliseconds

long

micronaut.views.freemarker.strict-syntax-mode

boolean

micronaut.views.freemarker.object-wrapper

freemarker.template.ObjectWrapper

micronaut.views.freemarker.locale

java.util.Locale

micronaut.views.freemarker.time-zone

java.util.TimeZone

micronaut.views.freemarker.template-exception-handler

freemarker.template.TemplateExceptionHandler

micronaut.views.freemarker.attempt-exception-reporter

freemarker.template.AttemptExceptionReporter

micronaut.views.freemarker.log-template-exceptions

boolean

micronaut.views.freemarker.wrap-unchecked-exceptions

boolean

micronaut.views.freemarker.incompatible-enhancements

java.lang.String

micronaut.views.freemarker.whitespace-stripping

boolean

micronaut.views.freemarker.auto-escaping-policy

int

micronaut.views.freemarker.output-format

freemarker.core.OutputFormat

micronaut.views.freemarker.registered-custom-output-formats

java.util.Collection

micronaut.views.freemarker.recognize-standard-file-extensions

boolean

micronaut.views.freemarker.tag-syntax

int

micronaut.views.freemarker.interpolation-syntax

int

micronaut.views.freemarker.naming-convention

int

micronaut.views.freemarker.tab-size

int

micronaut.views.freemarker.default-encoding

java.lang.String

micronaut.views.freemarker.shared-varibles

java.util.Map

micronaut.views.freemarker.all-shared-variables

freemarker.template.TemplateHashModelEx

micronaut.views.freemarker.localized-lookup

boolean

micronaut.views.freemarker.incompatible-improvements

freemarker.template.Version

the FreeMarker version number where the not 100% backward compatible bug fixes and improvements that you want to enable were already implemented. Defaults to {@link Configuration#DEFAULT_INCOMPATIBLE_IMPROVEMENTS}.

Views Handlebars Config Properties

🔗
Table 5. Configuration Properties for HandlebarsViewsRendererConfigurationProperties
Property Type Description

micronaut.views.handlebars.enabled

boolean

Whether handlebars view rendering is enabled. Default value (true).

micronaut.views.handlebars.default-extension

java.lang.String

The default extension. Default value ("hbs").

Views Rocker Config Properties

🔗
Table 6. Configuration Properties for RockerViewsRendererConfigurationProperties
Property Type Description

micronaut.views.rocker.enabled

boolean

Whether Rocker views are enabled. Default value (true).

micronaut.views.rocker.default-extension

java.lang.String

Sets the default extension to use for Rocker templates. Default value ("rocker.html").

micronaut.views.rocker.hot-reloading

boolean

Whether hot reloading is enabled. Default value (false).

micronaut.views.rocker.relaxed

boolean

Whether relaxed binding is enabled for dynamic templates. Default value (false).

Views Soy Config Properties

🔗
Table 7. Configuration Properties for SoyViewsRendererConfigurationProperties
Property Type Description

micronaut.views.soy.enabled

boolean

Whether Soy-backed views are enabled.

micronaut.views.soy.renaming-enabled

boolean

Turns renaming on or off.

Views Thymeleaf Config Properties

🔗
Table 8. Configuration Properties for ThymeleafViewsRendererConfigurationProperties
Property Type Description

micronaut.views.thymeleaf.enabled

boolean

Sets whether thymeleaf rendering is enabled. Default value (true).

micronaut.views.thymeleaf.character-encoding

java.lang.String

Sets the character encoding to use. Default value ("UTF-8").

micronaut.views.thymeleaf.template-mode

org.thymeleaf.templatemode.TemplateMode

Sets the template mode.

micronaut.views.thymeleaf.suffix

java.lang.String

Sets the suffix to use.

micronaut.views.thymeleaf.force-suffix

boolean

Sets whether to force the suffix. Default value (false).

micronaut.views.thymeleaf.force-template-mode

boolean

Sets whether to force template mode. Default value (false).

micronaut.views.thymeleaf.cacheable

boolean

Sets whether templates are cacheable.

micronaut.views.thymeleaf.cache-ttlms

java.lang.Long

Sets the cache TTL in millis.

micronaut.views.thymeleaf.check-existence

boolean

Sets whether templates should be checked for existence.

micronaut.views.thymeleaf.cache-ttl

java.time.Duration

Sets the cache TTL as a duration.

Views Velocity Config Properties

🔗
Table 9. Configuration Properties for VelocityViewsRendererConfigurationProperties
Property Type Description

micronaut.views.velocity.enabled

boolean

Whether velocity views are enabled. Default value (true).

micronaut.views.velocity.default-extension

java.lang.String

Sets the defautlt extension to use for velocity templates. Default value ("vm").