Commit 85ac8f6b authored by Dave Syer's avatar Dave Syer

Add config hint to template error messages

parent d2fc80b8
...@@ -67,9 +67,12 @@ public class FreeMarkerAutoConfiguration { ...@@ -67,9 +67,12 @@ public class FreeMarkerAutoConfiguration {
if (this.properties.isCheckTemplateLocation()) { if (this.properties.isCheckTemplateLocation()) {
Resource resource = this.resourceLoader.getResource(this.properties Resource resource = this.resourceLoader.getResource(this.properties
.getTemplateLoaderPath()); .getTemplateLoaderPath());
Assert.state(resource.exists(), "Cannot find template location: " + resource Assert.state(
+ " (please add some templates " resource.exists(),
+ "or check your FreeMarker configuration)"); "Cannot find template location: "
+ resource
+ " (please add some templates, check your FreeMarker configuration, or set "
+ "spring.freemarker.checkTemplateLocation=false)");
} }
} }
......
...@@ -69,9 +69,11 @@ public class VelocityAutoConfiguration { ...@@ -69,9 +69,11 @@ public class VelocityAutoConfiguration {
if (this.properties.isCheckTemplateLocation()) { if (this.properties.isCheckTemplateLocation()) {
Resource resource = this.resourceLoader.getResource(this.properties Resource resource = this.resourceLoader.getResource(this.properties
.getResourceLoaderPath()); .getResourceLoaderPath());
Assert.state(resource.exists(), "Cannot find template location: " + resource Assert.state(
+ " (please add some templates " resource.exists(),
+ "or check your Velocity configuration)"); "Cannot find template location: "
+ resource
+ " (please add some templates, check your Velocity configuration, or set spring.velocity.checkTemplateLocation=false)");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment