server.context-path配置访问路径不起作用

今天在用idea遇到了一些问题,我在用server.context-path配置访问路径时不起作用,上网查了资料,就是springboot版本不同造成,我就统计了需要注意新旧版不同的一些代码。

1.server.context-path配置文件访问路径
旧版:server.context-path
新版:server.servlet.context-path

2.spring.config.location命令行参数引用外部配置文件
旧版:spring.config.location
新版:spring.config.additional-location

3.@Email注解无作用
在新版需要添加依赖启动器:
在这里插入图片描述
4.WebMvcConfigurerAdapter类过时
新版:WebMvcConfigurer接口

5.EmbeddedServletContainerCustomizer类不存在
springboot2.0以上版本:
被WebServerFactoryCustomizer替代

猜你喜欢

转载自blog.csdn.net/ShanLanF/article/details/107717386
今日推荐