Add config hint to template error messages

This commit is contained in:
Dave Syer 2014-05-19 16:53:58 +01:00
parent d2fc80b818
commit 85ac8f6b05
2 changed files with 11 additions and 6 deletions

View File

@ -67,9 +67,12 @@ public class FreeMarkerAutoConfiguration {
if (this.properties.isCheckTemplateLocation()) {
Resource resource = this.resourceLoader.getResource(this.properties
.getTemplateLoaderPath());
Assert.state(resource.exists(), "Cannot find template location: " + resource
+ " (please add some templates "
+ "or check your FreeMarker configuration)");
Assert.state(
resource.exists(),
"Cannot find template location: "
+ resource
+ " (please add some templates, check your FreeMarker configuration, or set "
+ "spring.freemarker.checkTemplateLocation=false)");
}
}

View File

@ -69,9 +69,11 @@ public class VelocityAutoConfiguration {
if (this.properties.isCheckTemplateLocation()) {
Resource resource = this.resourceLoader.getResource(this.properties
.getResourceLoaderPath());
Assert.state(resource.exists(), "Cannot find template location: " + resource
+ " (please add some templates "
+ "or check your Velocity configuration)");
Assert.state(
resource.exists(),
"Cannot find template location: "
+ resource
+ " (please add some templates, check your Velocity configuration, or set spring.velocity.checkTemplateLocation=false)");
}
}