New to Spring boot, I wrote a home method in the Controller to return a homePage view.
Thinking of the past in spring-mvc, you can configure suffix to specify the suffix of the access path.
After searching, the official website introduced such a configuration, spring.mvc.view.suffix. Then I added spring.mvc.view.suffix=.html to application.properties and found that whether I accessed localhost:8080/home or localhost:8080/home.html, I could get the correct view.
How to make only access paths ending with .html valid? Why doesn't this configuration here work?
The urls of spring boot are all rest style. If you want to specify the url suffix, refer to my previous answer about spring boot custom url suffix
The spring.mvc.view.suffix=.html configured here and the
in sping mvcThis has the same function, it is not the requested suffix. The requested suffix is filtered and configured in your configuration class