快速搭建spring boot框架 干货

 

第一步:IntelliJ IDEA创建一个spring boot的框架,引入(web,servlet,mybatis,mysqld)的jar包;

快速搭建spring boot框架 干货

 

第二步:在src/main下创建webapp/WEB-INF/views文件夹,并添加项目结构;

快速搭建spring boot框架 干货

 

第三步:在application.yml文件中将spring文件重定向到/WEB-INF/views目录下,并添加数据库驱动;

快速搭建spring boot框架 干货

 

第四步:创建student类,mapper,studentController,和listStudent.jsp文件,数据库创建相应的表;

快速搭建spring boot框架 干货

 

Student.java

快速搭建spring boot框架 干货

 

StudentMapper.java

快速搭建spring boot框架 干货

 

StudentController.java

快速搭建spring boot框架 干货

 

listStudent.jsp

快速搭建spring boot框架 干货

 

 

第五步:运行SpringbootApplication,访问http://localhost:8080/list:

快速搭建spring boot框架 干货