spring boot plugin_Spring框架详解

步骤

1.创建Springboot:

bd17c0b9b041425c9d8ac5749b54a498

如果想学习Java工程化、高性能及分布式、深入浅出。微服务、Spring,MyBatis,Netty源码分析的朋友可以加我的Java高级交流:787707172,群里有阿里大牛直播讲解技术,以及Java大型互联网技术的视频免费分享给大家。

2.创建项目文件结构

89c3f2c3f89d4cf9b92c341778ce41e1

3.POM依赖

如果使用阿里云的连接池不选择JDBC,小编用的阿里云这里不选择

e0bd1be556044a1797a21a2274a5d154

点击Finish;

注:可能Maven中无Jar包需要从仓库下载,需要耐心等待(可以去听首歌)

4.项目结构

530aabe546e44b97b4a652a487cabcf1

5.POM

<?xml version="1.0" encoding="UTF-8"?>4.0.0org.springframework.boot spring-boot-starter-parent 2.1.1.RELEASEcom.spring boot 0.0.1-SNAPSHOTbootDemo project for Spring Boot1.8org.springframework.boot spring-boot-devtools truecom.alibaba druid-spring-boot-starter 1.1.10org.springframework.boot spring-boot-starter-thymeleaf org.springframework.boot spring-boot-starter-web org.mybatis.spring.boot mybatis-spring-boot-starter 1.3.2mysql mysql-connector-java runtimeorg.springframework.boot spring-boot-starter-test testorg.springframework.boot spring-boot-maven-plugin 

注:IDEA失效解决方法

a36c46610d0c482e9ced17463dc444b3

6.小编使用的application.properties文件,项目启动识别两种格式的文件properties和yml文件:

#缓存设置为false, 修改之后马上生效spring.thymeleaf.cache=falsespring.thymeleaf.encoding=UTF-8#spring.thymeleaf.prefix=classpath:/templates/#spring.thymeleaf.suffix=.html server.port=8080server.tomcat.uriEncoding=utf-8 spring.datasource.type=com.alibaba.druid.pool.DruidDataSourcespring.datasource.url=jdbc:mysql://localhost:3306/web?useUnicode=true&serverTimezone=GMT%2B8&characterEncoding=utf-8&allowMultiQueries=true&useSSL=falsespring.datasource.username=rootspring.datasource.password=rootspring.datasource.druid.driverClassName=com.mysql.cj.jdbc.Driver#初始化连接spring.datasource.initialSize=20#最大空闲数spring.datasource.maxActive=50#最小空闲数spring.datasource.minIdle=10#获取连接等待时间#spring.datasource.druid.max-wait=60000#最小等待时间#spring.datasource.minEvictableIdleTimeMillis=36000007.其他文件生成User.javapackage com.spring.boot.bean; public class User {  public Integer uid; public String uname; public String upassword;  public Integer getUid() { return uid; }  public void setUid(Integer uid) { this.uid = uid; }  public String getUanme() { return uname; }  public void setUanme(String uanme) { this.uname = uanme; }  public String getUpassword() { return upassword; }  public void setUpassword(String upassword) { this.upassword = upassword; }  @Override public String toString() { return "User{" + "uid=" + uid + 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值