From 17f05467bc0a048a69a5dbff061e579e9a02af8e Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 4 Feb 2015 11:33:40 +0000 Subject: [PATCH] =?UTF-8?q?Document=20IDEA=E2=80=99s=20quirky=20classpath?= =?UTF-8?q?=20ordering=20and=20its=20effect=20on=20templates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes gh-2319 --- .../src/main/asciidoc/spring-boot-features.adoc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 2243948ba0..840dda6e90 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -1087,13 +1087,21 @@ Spring Boot includes auto-configuration support for the following templating eng * http://www.thymeleaf.org[Thymeleaf] * http://velocity.apache.org[Velocity] -When you're using one of these templating engines with the default configuration, your -templates will be picked up automatically from `src/main/resources/templates`. - TIP: JSPs should be avoided if possible, there are several <> when using them with embedded servlet containers. +When you're using one of these templating engines with the default configuration, your +templates will be picked up automatically from `src/main/resources/templates`. + +TIP: IntelliJ IDEA orders the classpath differently depending on how you run your +application. Running your application in the IDE via its main method will result in a +different ordering to when you run your application using Maven or Gradle or from its +pacakaged jar. This can cause Spring Boot to fail to find the templates on the classpath. +If you're affected by this problem you can reorder the classpath in the IDE to place +the module's classes and resources first. Alternatively, you can configure the template +prefix to search every templates directory on the classpath: `classpath*:/templates/`. + [[boot-features-error-handling]]