spingboot 可以添加自定义的配置,需要在application.yml文件中添加,并设置对应的Config类解析。当然也可以指定配置文件,及相关的解析前缀。
application.yml
server: servlet: context-path: /patient port: 8080spring: thymeleaf: encoding: UTF-8 mode: HTML
Config.java