Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem that SpringBoot cannot find the html resource and report an error?

Shulou Source: shulou.com Published: 2022-06-01 09:37:49 09月30日 Update

This article mainly introduces the SpringBoot can not find html resources how to solve the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that after reading this SpringBoot can not find html resources how to solve the article will have a harvest, let's take a look.

The reason why SpringBoot cannot find the html resource is that SpringBoot starts the access directly after writing the Controller, but cannot find the corresponding page resource.

There are no errors in my Controller writing, and the html file is in the templates folder, but why can't I find the resources?

I found that the thymeleaf package I imported is wrong. Please do not import the thymeleaf package under the Maven library. It will not be automatically configured in SpringBoot. It is this package that you want to import.

Org.springframework.boot spring-boot-starter-thymeleaf

After importing this package, start it and access it normally.

This is the end of the article on "how to solve the problem when SpringBoot cannot find html resources". Thank you for your reading. I believe that everyone has a certain understanding of the knowledge of "SpringBoot can not find html resources how to solve the problem". If you want to learn more, you are welcome to follow the industry information channel.

Tags: Resources knowledge content documents articles errors errors values reasons easy to operate folders articles easy to understand more look industry information channels pages channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker OPPO Reno Shulou Tech Info macOS Shulou Technology