Spring Boot配置

Spring Boot MySQL配置:

  • MySql配置

application.properties文件

#数据库参数配置
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.max-idle=10
spring.datasource.max-wait=10000
spring.datasource.min-idle=5
spring.datasource.initial-size=5

 

  • tomcat服务器配置

application.properties文件

#端口号设置
server.port=8011
#session超时时间(分钟)
server.session.timeout=30
#编码 解决后台传数据到前台,中文乱码的问题
server.tomcat.uri-encoding=UTF-8
  • 项目热部署(修改代码之后自动部署,不需重启服务)

pom.xml文件

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
</dependency>
  • 跳转html页面

pom.xml文件

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

注:官方推荐使用thymeleaf,freemarker等模版引擎,不推荐jsp的支持(为什么不推荐使用jsp呢,或者说为什么舍弃掉jsp呢)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值