thymeleaf-spring icon indicating copy to clipboard operation
thymeleaf-spring copied to clipboard

Problem changing templates folder

Open callor opened this issue 7 months ago • 0 comments

I want to change the resources/templates folder to resources/views in a spring boot project.

However, if I change the templates folder to a different name (I use views), the Controller does not recognize the folder. When I run the project and execute the Request, the *.html file is loaded normally and displayed on the screen. However, it is inconvenient because a warning (or error) keeps appearing in the IntelliJ IDE. Please tell me how to solve it.

Image

The resources/application.yaml file is set as follows:

spring:
  application:
    name: myapp

  thymeleaf:
    prefix: classpath:/views/
    suffix: .html
    mode: HTML
    cache: false

The views folder of the project is as follows:

Image

callor avatar Mar 19 '25 03:03 callor