Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VelocityLanguageDriverConfig #72

Merged
merged 1 commit into from
May 4, 2019
Merged

Conversation

kazuki43zoo
Copy link
Member

Fixes gh-66

This PR includes following main changes.

Adding the VelocityLanguageDriverConfig

Adding the VelocityLanguageDriverConfig for configuring a mybatis-velocity and template engine of Velocity. This change keep backward compatibility with mybatis-thymeleaf 2.0 or under.

Specify a Velocity template engine configuration

Following settings are same mean.

Previous version(2.0):

resource.default_encoding=Windows-31J

New version(2.1+):

# velocity-settings.{name}={value} format
velocity-settings.resource.default_encoding=Windows-31J

Specify additional context attributes

Following settings are same mean.

Previous version(2.0):

additional.context.attributes=attribute1:com.example.Attribute1,attribute2:com.example.Attribute2

New version(2.1+):

# additional-context-attributes.{name}={value(FQCN)} format
additional-context-attributes.attribute1=com.example.Attribute1
additional-context-attributes.attribute2=com.example.Attribute2

NOTE:

additional.context.attributes will deprecate.

Specify user defined directives

Previous version(2.0):

userdirective=com.example.MyDirective,com.example.CustomDirective

New version(2.1+):

velocity-settings.runtime.custom_directives=com.example.MyDirective,com.example.CustomDirective

# or

runtime.custom_directives=com.example.MyDirective,com.example.CustomDirective

NOTE:

userdirective is deprecated (recommend to use the runtime.custom_directive provided by Velocity)

Add commons-text as dependency artifact

I've added the Apache common-text for supporting the type-safe configuration properties.

Drop commons-lang3

I've removed the Apache commons-lang3 as project dependency artifact because StringUtils is no longer used by this change.

Discontinue use of deprecated properties

The mybatis-velocity 2.0 used deprecated properties as follow:

[main] WARN org.apache.velocity.deprecation - configuration key 'class.resource.loader.class' has been deprecated in favor of 'resource.loader.class.class'
[main] WARN org.apache.velocity.deprecation - configuration key 'resource.loader' has been deprecated in favor of 'resource.loaders'
[main] WARN org.apache.velocity.deprecation - configuration key 'userdirective' has been deprecated in favor of 'runtime.custom_directives'
[main] WARN org.apache.velocity.deprecation - configuration key 'userdirective' has been deprecated in favor of 'runtime.custom_directives'
[main] WARN org.apache.velocity.deprecation - configuration key 'userdirective' has been deprecated in favor of 'runtime.custom_directives'
[main] WARN org.apache.velocity.deprecation - configuration key 'userdirective' has been deprecated in favor of 'runtime.custom_directives'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add VelocityLanguageDriverConfig like as mybatis-thymeleaf
1 participant