我终于找到了!正确的配置是这样的:
@Configurationpublic class VersioningMappingHandlerConfig { @Bean public ApiVersionRequestMappingHandlerMapping customMappingHandlerMapping() { ApiVersionRequestMappingHandlerMapping handler = new ApiVersionRequestMappingHandlerMapping("v", 1, 1); handler.setOrder(-1); return handler; }}
注意:没有
extends WebMvcConfigurationSupport,bean名称是
customMappingHandlerMapping
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)