0

I am creating a Spring Boot application with Spring Boot 3.3.0. I have placed my entities in a package called entities under the primary application package, and the controller is located in a package called controllers inside the main application package.

project structure

When I attempt to access any of the controller endpoints, I get a 404 error; For example when hitting localhost:8080/account-types/create the error returned is "There was an unexpected error (type=Not Found, status=404). No static resource account-types/account_type_create."

Templates: HTML templates

Controller Method: controller method

0

1 Answer 1

1

Everything is right in your code. It will work if you add thymeleaf dependency. For gradle it is

    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'

For maven

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

Not the answer you're looking for? Browse other questions tagged or ask your own question.