Browse Source

Add config hint to template error messages

pull/890/merge
Dave Syer 12 years ago
parent
commit
85ac8f6b05
  1. 9
      spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfiguration.java
  2. 8
      spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/velocity/VelocityAutoConfiguration.java

9
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfiguration.java

@ -67,9 +67,12 @@ public class FreeMarkerAutoConfiguration { @@ -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)");
}
}

8
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/velocity/VelocityAutoConfiguration.java

@ -69,9 +69,11 @@ public class VelocityAutoConfiguration { @@ -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)");
}
}

Loading…
Cancel
Save