- Added custom namespace definition for (spring-template-1.2.xsd) the associated entry in NamespaceParserRegistry
- Added documentation for the spring template nvelocity implementation
This commit is contained in:
@@ -80,6 +80,19 @@ namespace Spring.Template.Velocity.Tests.Template.Velocity {
|
||||
Assert.AreEqual(string.Format("value={0}", TEST_VALUE), mergedTemplate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the fileBasedVelocityEngine bean configuration from VelocityEngineFactoryObjectTests.xml
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestMergeUsingCustomNamespaceDefinition() {
|
||||
VelocityEngine velocityEngine =
|
||||
appContext.GetObject("customNamespaceVelocityTemplate") as VelocityEngine;
|
||||
Assert.IsNotNull(velocityEngine, "velocityEngine is null");
|
||||
string mergedTemplate = VelocityEngineUtils.MergeTemplateIntostring(velocityEngine, "SimpleTemplate.vm",
|
||||
Encoding.UTF8.WebName, model);
|
||||
Assert.AreEqual(string.Format("value={0}", "TEST_VALUE"), mergedTemplate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test using definition of ResourceLoaderPath (file-based configuration) referencing just the template name
|
||||
/// </summary>
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<objects xmlns="http://www.springframework.net">
|
||||
<objects xmlns="http://www.springframework.net" xmlns:template="http://www.springframework.net/template">
|
||||
|
||||
<template:nvelocity id="customNamespaceVelocityTemplate" >
|
||||
<template:resource-loader>
|
||||
<template:file path="Template/Velocity/" />
|
||||
</template:resource-loader>
|
||||
</template:nvelocity>
|
||||
|
||||
|
||||
<!-- Does file system access with hot tracking with NVelocity assembly resource loader -->
|
||||
<object id="assemblyBasedVelocityEngine" type="Spring.Template.Velocity.VelocityEngineFactoryObject, Spring.Template.Velocity">
|
||||
@@ -39,5 +46,4 @@
|
||||
<property name="ResourceLoaderPath " value="Template/Velocity/" />
|
||||
<property name="PreferFileSystemAccess " value="false" />
|
||||
</object>
|
||||
|
||||
</objects>
|
||||
Reference in New Issue
Block a user