1.Springboot
A. Definition: Spring Boot is a new framework provided by the pivotal team designed to simplify the initial construction and development of new spring applications
B. Contractual directory structure: (Maven resource file directory/src/java/resources)
Spring-boot Project static file directory:/src/java/resources/static (usually put IMG, CSS, JS, etc.)
Spring-boot project template file directory:/src/java/resources/templates (general HTML file)
1. Role
In A.controller
@GetMapping ("/") // input path http://127.0.0.1:8080/access to Public String Index () { return ' index '; } @GetMapping ("/loginpapge") public String loginpapge () { return "Login"; }
In b.html
<!DOCTYPE HTML><HTMLLang= "en"xmlns:th= "http://www.thymeleaf.org"><Head> <MetaCharSet= "UTF-8"/> <title>Title</title></Head><Body>you are welcome:<spanTh:text= "${session.user.getusername ()}"></span> <Table> <TR> <th>Id</th> <th>Name</th> <th>Password</th> <th>State</th> </TR> <TRTh:each= "User,userstat: ${users}"> <TDTh:text= "${user.userid}"></TD> <TDTh:text= "${user.username}"></TD> <TDTh:text= "${user.userpwd}"></TD> <TDTh:text= "${user.usertype}"></TD> </TR> </Table></Body></HTML>
C. If you need to use spring Data Jpa, you need to configure APPLICATION.YML in/src/java/resources
Spring: thymeleaf: cache:false DataSource: username:root url:jdbc:mysql://127.0.0.1:3306/ j135 driver-class-name:com.mysql.jdbc.driver password:admin JPA: show-sql:true Database-platform:org.hibernate.dialect.mysql5dialect
The springboot of Java EE