This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch VELOCITY-951
in repository https://gitbox.apache.org/repos/asf/velocity-engine.git

commit 278082e12f4886a396c7f5b303e0ec355a1bfeae
Author: Michael Osipov <[email protected]>
AuthorDate: Sat Feb 3 21:46:17 2024 +0100

    [VELOCITY-951] DataSourceResourceLoader: property datasource_url wrong
---
 .../java/org/apache/velocity/runtime/RuntimeConstants.java | 14 ++++++++++----
 .../runtime/resource/loader/DataSourceResourceLoader.java  |  2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git 
a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeConstants.java
 
b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeConstants.java
index 89d3c41f..ced9d349 100644
--- 
a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeConstants.java
+++ 
b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/RuntimeConstants.java
@@ -65,7 +65,7 @@ public interface RuntimeConstants extends 
DeprecatedRuntimeConstants
      *  @since 2.2
      */
     String RUNTIME_LOG_TRACK_LOCATION = "runtime.log.track_location";
-    
+
     /*
      * ----------------------------------------------------------------------
      * D I R E C T I V E  C O N F I G U R A T I O N
@@ -90,7 +90,7 @@ public interface RuntimeConstants extends 
DeprecatedRuntimeConstants
      * @since 2.0
      */
     String CHECK_EMPTY_OBJECTS = "directive.if.empty_check";
-    
+
     /**
      * Starting tag for error messages triggered by passing a parameter not 
allowed in the #include directive. Only string literals,
      * and references are allowed.
@@ -220,7 +220,13 @@ public interface RuntimeConstants extends 
DeprecatedRuntimeConstants
     /**
      * Datasource loader datasource url
      */
-    String DS_RESOURCE_LOADER_DATASOURCE = 
"resource.loader.ds.resource.datasource_url";
+    String DS_RESOURCE_LOADER_DATASOURCE_URL = 
"resource.loader.ds.resource.datasource_url";
+
+    /**
+     * @deprecated Use {@link #DS_RESOURCE_LOADER_DATASOURCE_URL} instead.
+     */
+    @Deprecated
+    String DS_RESOURCE_LOADER_DATASOURCE = DS_RESOURCE_LOADER_DATASOURCE_URL;
 
     /**
      * Datasource loader templates table
@@ -446,7 +452,7 @@ public interface RuntimeConstants extends 
DeprecatedRuntimeConstants
 
     /** Whether to use string interning. */
     String RUNTIME_STRING_INTERNING = "runtime.string_interning";
-    
+
     /** Switch for the interpolation facility for string literals. */
     String INTERPOLATE_STRINGLITERALS = "runtime.interpolate_string_literals";
 
diff --git 
a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
 
b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
index b9cc48cc..668cfde2 100644
--- 
a/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
+++ 
b/velocity-engine-core/src/main/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
@@ -183,7 +183,7 @@ public class DataSourceResourceLoader extends ResourceLoader
     @Override
     public void init(ExtProperties configuration)
     {
-        dataSourceName  = 
StringUtils.trim(configuration.getString("datasource_url"));
+        dataSourceName  = 
StringUtils.trim(configuration.getString("resource.datasource_url"));
         tableName       = 
StringUtils.trim(configuration.getString("resource.table"));
         keyColumn       = 
StringUtils.trim(configuration.getString("resource.key_column"));
         templateColumn  = 
StringUtils.trim(configuration.getString("resource.template_column"));

Reply via email to