zoukankan      html  css  js  c++  java
  • springboot学习二:配置文件配置

    springboot默认读取application*.properties

    #######spring配置#######
    spring.profiles.active=dev //引入开发配置文件 application-dev.properties
    ##mvc配置 spring.mvc.view.prefix=/WEB-INF/views/ spring.mvc.view.suffix=.jsp spring.thymeleaf.cache=false spring.thymeleaf.enabled = false ## Mybatis 配置 mybatis.type-aliases-package=com.example.demo.domain //实体类
    mybatis.mapper-locations=classpath:dao/*Mapper.xml ##logback日志 logging.config=classpath:logback-spring.xml ##数据库配置Druid spring.datasource.type = com.alibaba.druid.pool.DruidDataSource spring.datasource.druid.driver-class-name=oracle.jdbc.driver.OracleDriver spring.datasource.druid.initialSize=1 spring.datasource.druid.maxActive=20 spring.datasource.druid.minIdle=1 spring.datasource.druid.maxWait=60000 spring.datasource.druid.timeBetweenEvictionRunsMillis=60000 spring.datasource.druid.minEvictableIdleTimeMillis=30000 spring.datasource.druid.validationQuery=SELECT 1 FROM DUAL spring.datasource.druid.testWhileIdle=true spring.datasource.druid.testOnBorrow=false spring.datasource.druid.testOnReturn=false spring.datasource.druid.poolPreparedStatements=true spring.datasource.druid.maxPoolPreparedStatementPerConnectionSize=20 spring.datasource.druid.filters=stat,wall

    springboot配置文件读取参考文档:

    https://blog.csdn.net/thc1987/article/details/78789426

    自定义读取配置文件也可用:java.util.Properties

  • 相关阅读:
    spring boot自动配置
    servlet类与Spring Controller类的关系
    Junit中的setup和teardown方法
    dependency的scope
    mapper的namespace
    mybatis缓存
    Ehcache(05)——缓存的查询
    Ehcache(04)——设置缓存的大小
    Ehcache(03)——Ehcache中储存缓存的方式
    Ehcache(02)——ehcache.xml简介
  • 原文地址:https://www.cnblogs.com/ctsx/p/10275773.html
Copyright © 2011-2022 走看看