About springboot access html page discussion

A, springboot project not directly access the templates folder and static html

Spring Boot by default / ** All access maps to the following directory:
classpath:/static
classpath:/public
classpath:/resources
classpath:/META-INF/resources

  templates folder for placing a template file, you need to view parser to parse it, it must be accessed through an internal server. That is, to go Controller - Services - view resolver (MVC) this process for the job, that is, the control layer to accept the request, and calls the service layer, a last attempt to return to the front.

  static folder, neither direct access nor access to the server. Therefore, this folder, you may be put some css, images such documents for internal reference server.

  html public folder can be accessed directly.

 

Note: If you want to access html templates folder, and must be accessed through mvc mode, both need to introduce jar package template class, such as freemarker.

The ultimate goal is to micro springboot service, instead of building a web project, we should abandon fixed ideas.

 

Guess you like

Origin www.cnblogs.com/lpob/p/11902097.html