Estou fazendo o curso usando o sts... ja vem algumas coisas configuradas porém acho que deve ter atrapalhado algo... Fiz o index, coloquei dentro da pasta templates, configurei o controller e deu pau... no video também da pau, e o instrutor pede pra colocar a dependencia do thymeleaf, porém notei que meu projeto ja tinha estes jars nas dependencias do maven. Coloquei a dependencia no pom e não funcionou também... alguém sabe pq?
Seguem as imagens do projeto:
POM
<?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>br.com.listavip</groupId>
<artifactId>listavip</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>listavip</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
<version>2.0.2.RELEASE</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Controller
package br.com.listavip.listavip;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class ConvidadoController {
@RequestMapping("/")
public String index(){
return "index";
}
}
https://uploaddeimagens.com.br/imagens/1-png-b3627088-abe3-412b-a422-3ec1e7b88e6a
https://uploaddeimagens.com.br/imagens/2-png-df476102-35f7-4588-8269-0ba03ef9d83b
https://uploaddeimagens.com.br/imagens/3-png-32249ead-ae68-4806-930c-357f977df45c
Desde ja agradeço!