Configuration Reference

Version:5.5.1

Micronaut Views Core Config Properties

🔗
Table 1. 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 2. 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 resources' folder where views should be searched for. Default value ("views").

micronaut.views.dir

java.lang.String

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

🔗
Table 3. Configuration Properties for CspConfiguration
Property Type Description

micronaut.views.csp.enabled

boolean

Sets whether CSP is enabled. Default value (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 value (false).

micronaut.views.csp.random-engine

java.util.Random

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

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.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.filter-path

java.lang.String

The path the CSP filter should apply to. Default value ("/**").

Micronaut Views Fieldset Config Properties

🔗
Table 4. Configuration Properties for FormElementRendererConfigurationProperties
Property Type Description

micronaut.views.form-element.render.enabled

boolean

Whether form element rendering is enabled. Default value (true).

🔗
Table 5. Configuration Properties for FormElementRendererViewsConfiguration
Property Type Description

micronaut.views.form-element.render.views.input-checkbox

java.lang.String

The view name for a field of type input checkbox.

micronaut.views.form-element.render.views.input-date

java.lang.String

The view name for a field of type input date.

micronaut.views.form-element.render.views.input-date-time-local

java.lang.String

The view name for a field of type input datetime-local.

micronaut.views.form-element.render.views.input-email

java.lang.String

The view name for a field of type input email.

micronaut.views.form-element.render.views.input-hidden

java.lang.String

The view name for a field of type input hidden.

micronaut.views.form-element.render.views.input-number

java.lang.String

The view name for a field of type input number.

micronaut.views.form-element.render.views.input-password

java.lang.String

The view name for a field of type input password.

micronaut.views.form-element.render.views.input-radio

java.lang.String

The view name for a field of type input radio.

micronaut.views.form-element.render.views.input-submit

java.lang.String

The view name for a field of type input submit.

micronaut.views.form-element.render.views.input-tel

java.lang.String

The view name for a field of type input tel.

micronaut.views.form-element.render.views.input-text

java.lang.String

The view name for a field of type input text.

micronaut.views.form-element.render.views.input-time

java.lang.String

The view name for a field of type input time.

micronaut.views.form-element.render.views.input-url

java.lang.String

The view name for a field of type input url.

micronaut.views.form-element.render.views.option

java.lang.String

The view name to render an option html element.

micronaut.views.form-element.render.views.select

java.lang.String

The view name for a field of type select.

micronaut.views.form-element.render.views.textarea

java.lang.String

The view name to render a textarea html element.

micronaut.views.form-element.render.views.trix-editor

java.lang.String

The view name for a field of type trix-editor.

Micronaut Views Freemarker Config Properties

🔗
Table 6. Configuration Properties for FreemarkerViewsRendererConfigurationProperties
Property Type Description

micronaut.views.freemarker.classic-compatible

boolean

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

int

micronaut.views.freemarker.locale

java.util.Locale

micronaut.views.freemarker.c-format

freemarker.core.CFormat

micronaut.views.freemarker.time-zone

java.util.TimeZone

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.template-exception-handler

freemarker.template.TemplateExceptionHandler

micronaut.views.freemarker.attempt-exception-reporter

freemarker.template.AttemptExceptionReporter

micronaut.views.freemarker.arithmetic-engine

freemarker.core.ArithmeticEngine

micronaut.views.freemarker.object-wrapper

freemarker.template.ObjectWrapper

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.truncate-builtin-algorithm

freemarker.core.TruncateBuiltinAlgorithm

micronaut.views.freemarker.log-template-exceptions

boolean

micronaut.views.freemarker.wrap-unchecked-exceptions

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.util.Properties

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.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.fallback-on-null-loop-variable

boolean

micronaut.views.freemarker.default-encoding

java.lang.String

micronaut.views.freemarker.shared-variables

java.util.Map

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.enabled

boolean

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

micronaut.views.freemarker.default-extension

java.lang.String

The default extension to use for freemarker templates. Default value ("ftl").

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. <p> Defaults to {@link Configuration#DEFAULT_INCOMPATIBLE_IMPROVEMENTS}.

Micronaut Views Handlebars Config Properties

🔗
Table 7. 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 file extension for templates. Default value ("hbs").

Micronaut Views Htmx Config Properties

🔗
Table 8. Configuration Properties for HtmxConfigurationProperties
Property Type Description

micronaut.views.htmx.enabled

boolean

Whether the htmx integration is enabled. Default value (true).

Micronaut Views Jte Config Properties

🔗
Table 9. Configuration Properties for JteViewsRendererConfigurationProperties
Property Type Description

micronaut.views.jte.dynamic

boolean

Whether to enable dynamic reloading of templates. Default value (false).

micronaut.views.jte.dynamic-path

java.lang.String

Root directory under which to write generated source and class files. . Default value ("build/jte-classes").

micronaut.views.jte.dynamic-source-path

java.lang.String

When using dynamic templates, the root source directory to search. If not specified, jte will search src/<sourceset>/jte and src/<sourceset>/resources/<folder> where 'folder' is ViewsConfiguration.getFolder(). In cases where the source directory cannot be found, jte will use classpath loading instead, and will not dynamically reload templates.

micronaut.views.jte.binary-static-content

boolean

Enable building binary content for templates. Default value (false). (Only has an effect when 'dynamic' is true. To use with precompiled templates, enable it in the build plugin)

Micronaut Views Pebble Config Properties

🔗
Table 10. Configuration Properties for PebbleConfigurationProperties
Property Type Description

micronaut.views.pebble.enabled

boolean

Sets whether the component is enabled. Default value (true).

micronaut.views.pebble.default-extension

java.lang.String

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

micronaut.views.pebble.cache-active

boolean

Enable/disable all caches, i.e. cache used by the engine to store compiled PebbleTemplate instances and tags cache. Default value (true).

micronaut.views.pebble.new-line-trimming

boolean

Changes the newLineTrimming setting of the PebbleEngine. By default, Pebble will trim a new line that immediately follows a Pebble tag. If set to false, then the first newline following a Pebble tag won’t be trimmed. All newlines will be preserved. Default value (true).

micronaut.views.pebble.auto-escaping

boolean

Sets whether or not escaping should be performed automatically. Default value (true).

micronaut.views.pebble.default-escaping-strategy

java.lang.String

Sets the default escaping strategy of the built-in escaper extension. Default value (EscapeFilter.HTML_ESCAPE_STRATEGY).

micronaut.views.pebble.strict-variables

boolean

Changes the strictVariables setting of the PebbleEngine. Default value (false).

micronaut.views.pebble.greedy-match-method

boolean

Enable/disable greedy matching mode for finding java method. Default is disabled. If enabled, when can not find perfect method (method name, parameter length and parameter type are all satisfied), reduce the limit of the parameter type, try to find other method which has compatible parameter types. Default value (false).

micronaut.views.pebble.allow-override-core-operators

boolean

Sets whether or not core operators overrides should be allowed. Default value (false).

micronaut.views.pebble.literal-decimals-as-integers

boolean

Enable/disable treat literal decimal as Integer. Default value (false), treated as Long.

micronaut.views.pebble.literal-numbers-as-big-decimals

boolean

Enable/disable treat literal numbers as BigDecimals. Default value (false), treated as Long/Double.

Micronaut Views React Config Properties

🔗
Table 11. Configuration Properties for ReactViewsRendererConfiguration
Property Type Description

micronaut.views.react.client-bundle-url

java.lang.String

the URL (relative or absolute) where the client Javascript bundle can be found. It will be appended to the generated HTML in a <script> tag. Defaults to "/static/client.js"

micronaut.views.react.server-bundle-path

java.lang.String

the path relative to micronaut.views.folder where the bundle used for server-side rendering can be found. Defaults to "classpath:views/ssr-components.mjs"

micronaut.views.react.render-script

java.lang.String

Either a file path (starting with "file:" or a resource in the classpath (starting with "classpath:") to a render script. Please see the user guide for more information on what this Javascript file should contain.

micronaut.views.react.sandbox

boolean

If true, GraalJS sandboxing is enabled. This helps protect you against supply chain attacks that might inject code into your server via hijacked React components. It requires a sufficiently new version of GraalJS. Defaults to OFF.

Micronaut Views Rocker Config Properties

🔗
Table 12. 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

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).

Micronaut Views Soy Config Properties

🔗
Table 13. Configuration Properties for SoyViewsRendererConfigurationProperties
Property Type Description

micronaut.views.soy.enabled

boolean

Whether Soy-backed views are enabled. Default value (true).

micronaut.views.soy.renaming-enabled

boolean

Specifies whether renaming is enabled. Defaults value (true).

Micronaut Views Thymeleaf Config Properties

🔗
Table 14. Configuration Properties for ThymeleafViewsRendererConfigurationProperties
Property Type Description

micronaut.views.thymeleaf.character-encoding

java.lang.String

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

micronaut.views.thymeleaf.template-mode

org.thymeleaf.templatemode.TemplateMode

The template mode to be used.

micronaut.views.thymeleaf.suffix

java.lang.String

The suffix to use. Default value (".html").

micronaut.views.thymeleaf.force-suffix

boolean

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

micronaut.views.thymeleaf.force-template-mode

boolean

Whether to force template mode. Default value (false).

micronaut.views.thymeleaf.cache-ttlms

long

The cache TTL in millis.

micronaut.views.thymeleaf.check-existence

boolean

Whether templates should be checked for existence.

micronaut.views.thymeleaf.cacheable

boolean

Whether templates are cacheable.

micronaut.views.thymeleaf.enabled

boolean

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

micronaut.views.thymeleaf.cache-ttl

java.time.Duration

Sets the cache TTL as a duration.

Micronaut Views Velocity Config Properties

🔗
Table 15. 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

The default extension to use for velocity templates. Default value ("vm").