application.properties的一些配置

server:
  port: 8089
  servlet:
    context-path: /Student
    #访问就通过http://localhost:8089/Student
spring:
    datasource:
        name: test
        url: jdbc:mysql://localhost:3306/Student4
        username: root
        password: root
        # 使用druid数据源  就应该写type:com.alibaba.druid.pool.DruidDataSource
        type: org.apache.commons.dbcp.BasicDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver
        tomcat:
              max-active: 150
              min-idle: 5
              max-idle: 20
              initial-size: 30
              log-abandoned: true
              remove-abandoned: true
              remove-abandoned-timeout: 10
              time-between-eviction-runs-millis: 600000
              min-evictable-idle-time-millis: 300000
              validation-query: SElECT'x'
              test-while-idle: true
              test-on-return: false
               #打开PSCache,并指定每个连接上PSCache的大小。oracle设为true,mysql设为false。分库分表较多推荐设置为false
    thymeleaf:
        cache: false      #缓存
        prefix: classpath:/templates/ # 模板文件路径前缀
        suffix: .html
        encoding: UTF-8
        mode: HTML5
        enabled: true #是否启用thymeleaf作为视图解析
        enable-spring-el-compiler: true # 是否spring el 表达式         
              
              
#        filters: stat
#        maxActive: 20
#        initialSize: 1
#        maxWait: 60000
#        minIdle: 1
#        timeBetweenEvictionRunsMillis: 60000
#        minEvictableIdleTimeMillis: 300000
#        validationQuery: select 'x'
#        testWhileIdle: true
#        testOnBorrow: false
#        testOnReturn: false
#        poolPreparedStatements: true
#        maxOpenPreparedStatements: 20
 ## 该配置节点为独立的节点,有很多同学容易将这个配置放在spring的节点下,导致配置无法被识别
 
mybatis:
       mapper-locations: classpath:mapping/*.xml  #注意:一定要对应mapper映射xml文件的所在路径,告诉它映射文件放在哪里
       type-aliases-package: com.example.demo.vo  # 注意:对应实体类的路径,别名所在的包
       configuration:
           call-setters-on-nulls: true
           cache-enabled: false
    
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值