Skip to content

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' 
@kazuki43zoo kazuki43zoo merged commit 9a1f0cc into mybatis:master May 4, 2019
@kazuki43zoo kazuki43zoo deleted the gh-66 branch May 4, 2019 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant