Spring boot + thymeleaf + bootstrap to realize the background management system interface

Recently, I'm learning spring boot. Learning a framework is nothing more than using it to do what I did before. The comparison between the two is different. Let's talk about my experience. Let's first talk about spring boot, micro framework. Rapid development is equivalent to zero configuration. From a great God's point of view, spring boot is equivalent to the framework of the framework, which integrates a lot of dependencies. In this way, you can't see the configuration. For developers who are used to configuration and just use spring boot, they may not be used to anything, I can't see the configuration. I feel a little strange to the overall architecture of the project. Besides, I use thymeleaf in spring boot. Take the simplest example to illustrate that JSP shows HelloWorld and thymeleaf shows HelloWorld. They are different in terms of POM file dependency and property file configuration. Do not introduce thymeleaf dependency when using JSP. Of course, do not introduce JSP dependency when using thymeleaf, which may lead to conflict, Spring boot is officially recommended to use thymeleaf. I personally feel it's also good. Let's start the project!

1. First, build a mean project and take a look at the overall structure of the project

Build the project structure and get POM XML. This demo only uses thymeleaf. It has no database dependency and requires very little dependency

Set up application. In Src / main / resource Properties file

Write entry program

The controller jumps to the bootstrap interface

Where is the bootstrap JS CSS introduced? Put it in the static folder, and put the page in views

index. The HTML interface is stored in the views folder under Src / main / resource. Why is it not tepmlates? Because views is written in the attribute configuration file, the prefix and suffix of thymeleaf can be changed

After that, run the application and enter localhost: 8080

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>