1.空指针的解决方法:在application.yml中填加
spring:
mvc:
pathmatch:
matching-strategy: ant_path_matcher
原因:springboot2.6.x的版本中springmvc默认路径匹配策略从ANT_PATH_MATCHER改成PATH_PATTERN_PARSER所以就有错误了,解决方法就是在配置文件中改成ANT_PATH_MATCHER模式
2.swagger3.0.0 的后台访问
从原先的http://localhost:8080/swagger-ui.html的变为http://localhost:8080/swagger-ui/index.html
源码:SpringfoxConfigurationProperties
/**
* Base url for swagger-ui. For e.g. setting it to /documentation will put swagger-ui
* at /documentation/swagger-ui/index.html
*/
private String baseUrl = "";
本文介绍了在SpringBoot 2.6.x版本中遇到的空指针问题及解决方案,通过在application.yml中设置spring.mvc.pathmatch.matching-strategy为ant_path_matcher来修复。同时,文章还提到了Swagger3.0.0的后台访问路径变化,现在应访问http://localhost:8080/swagger-ui/index.html进行API文档查看。
994

被折叠的 条评论
为什么被折叠?



