I have a Spring boot application. I am trying to pass a variable to an HTML file, but unfortunately I was not able to do this because when I run my application nothing is displayed except for the static text: "WORLD". My controller:
@Controller
public class IndexController {
@RequestMapping(value = "/index", method = RequestMethod.GET)
public String index(Model model) {
model.addAttribute("message", "HELLO");
return "index";
}
}
And my index.html:
<html>
<body>
<h1>${message}</h1>
<h2>WORLD</h2>
</body>
</html>
I searched for an answer and I found the following topics:
How to serve .html files using Spring
enter the link here
How to handle static content in Spring MVC?
There are useful examples, but in my project I do not have such files as: mvc-dispatcher-servlet.xml, web.xml or even the entire WEB-INF directory ...
I had these files when I created the Spring MVC project. And then everything worked fine - passing variables to JSP files. Should I add these files or what?
Here is the hierarchy of project files:

My pom.xml file:
<?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>offersmanager</groupId>
<artifactId>webapp</artifactId>
<version>1</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.6.RELEASE</version>
</parent>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>model</artifactId>
<version>${project.version}</version>
</dependency>
<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>
<sourceDirectory>src/main/java</sourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<testSourceDirectory>src/test/java</testSourceDirectory>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
</build>
<repositories>
<repository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>https://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
</project>