application.properties文件注释
这是一个常用的Spring Boot配置文件
在这里,我们可以配置应用程序的各种属性
服务器端口号
server.port=8080
数据库配置
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
项目名称
spring.application.name=MyProject
设置日志级别
logging.level.root=info
静态资源路径
spring.resources.static-locations=classpath:/static/
是否开启自动配置
spring.autoconfigure.enabled=true
默认字符集
spring.http.encoding.charset=UTF-8
资源缓存过期时间
spring.resources.cache.period=86400
启用国际化
spring.messages.basename=i18n/messages
spring.messages.fallback-to-system-locale=false
上下文路径
server.servlet.contextPath=/myapp
支持JSON格式输出
spring.http.converters.preferred-json-mapper=jackson