POMbotte de printemps avec thymeleaf ne fonctionne pas
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.6.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
application
@SpringBootApplication
public class Application {
public static void main(String args[]){
SpringApplication.run(Application.class);
}
}
Contrôleur
@Controller
@RequestMapping("/index")
public class IndexController {
@RequestMapping("/")
String index(){
return "index";
}
}
dossier J'ai aussi des modèles dans le dossier des ressources et à l'intérieur error.html et index .html
Lorsque j'accède à localhost: 8080/index l'erreur est affichée et non l'index. Qu'est-ce que je fais mal? C'est vraiment la configuration la plus simple possible et c'est déjà faux ...
Avez-vous un fichier application.properties? –
Je ne l'ai pas, ce n'est pas nécessaire – Greyshack