Skip to content

Problem changing templates folder #332

Open
@callor

Description

@callor

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions