首页 > 代码库 > SpringBoot中的常用配置
SpringBoot中的常用配置
一 . 关于在application.properties文件中的一些常见配置
1.server.port=8888 :表示配置端口
2.server.context-path 表示自定义上下文路径
3.server.tomcat.uri-encoding = UTF-8 表示用于解码URI的字符编码。
4.spring.http.encoding.charset = UTF-8 #HTTP请求和响应的字符集。如果未明确设置,则添加到“Content-Type”头。
5.启用健康检查,首先必须先要添加支持的jar包
配置在maven项目下的pom.xml文件中
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
6.#关闭actutor的安全认证
7.#http://localhost:8888/sb/health 查看springboot健康状况是否良好
8.#http://localhost:8888/sb/beans 类似于struts<s:debug>
9.#http://localhost:8888/sb/dump dump出线程和内存使用情况
10.#http://localhost:8888/sb/env java和springboot的环境变量
11.management.security.enabled=false
12.#启动url shutdown
endpoints.shutdown.enabled=true
SpringBoot中的常用配置
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。