springboot中Application.yml常用配置

访问端口,路径名

server:
  port: 9000
  servlet:
    context-path: /、

mybatis配置
mybatis:
  mapper-locations: classpath:/mybatis/mapper/*.xml
  type-aliases-package: cn.yilixun.jt.cfec.pj.vo
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

spring.freemarker配置
spring:

连接数据库
  datasource:
    url: jdbc:mysql://localhost:3306/sqlName?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
    username: root
    password: root

连接其他配置文件
  profiles:
    active: dev
  application:
    name: pj
  freemarker:

连接html的文件路径
    template-loader-path: classpath:/templates
    cache: false
    charset: UTF-8
    check-template-location: true
    content-type: text/html
    expose-request-attributes: false
    expose-session-attributes: false
    request-context-attribute: request
    suffix: .html

上传文件的大小设置
  servlet:
    multipart:
      max-file-size: 50MB
      max-request-size: 50MB

数据库连接池
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    driver-class-name: com.mysql.jdbc.Driver
method:
  invoke:
    packageVo: cn.yilixun.jt.cfec.pj.vo
upload:
  maxSize: 10
  fileType: .png,.jpg,.jpeg,.gif,.bmp,.flv,.swf,.mkv,.avi,.rm,.rmvb,.mpeg,.mpg,.ogg,.ogv,.mov,.wmv,.mp4,.webm,.mp3,.wav,.mid,.rar,.zip,.tar,.gz,.7z,.bz2,.cab,.iso,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.txt,.md,.xml
  errorMsg:
    empty: 文件为空或不存在
    filetype: 不能上传该类型的文件
    maxsize: 文件大小超出允许上传的上限(10M)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值