Я создаю приложение SpringBoot, которое использует Thymeleaf для обслуживания HTML-страниц. Вот моя структура проекта:
├── src
│ ├── main
│ │ ├── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── testrest
│ │ │ ├── CustomerController.java
│ │ │ ├── Customer.java
│ │ │ ├── CustomerRepository.java
│ │ │ └── DemoApplication.java
│ │ └── resources
│ │ ├── application.properties
│ │ ├── static
│ │ └── templates
│ │ ├── customer.html
│ │ └── index.html
Проблема, с которой я сталкиваюсь, заключается в том, что я могу достичь только "http://localhost:8080", который корректно возвращает страницу index.html. Если я пытаюсьдостичь "http://localhost:8080/customer.html" или даже" http://localhost:8080/index.html" страница, я получаю страницу не найдена ошибка. Это вопрос зависимостей? Я использую базовый набор зависимостей:
<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-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
Я также пытался явно установить корневой контекст:
server.servlet.context-path=/
Но я все еще не могу обслужить любую страницу HTML. Любая помощь? Спасибо!