1.config配置文件
@Configuration(proxyBeanMethods = false)
public class WebConfig implements WebMvcConfigurer {
public void configurePathMatch(PathMatchConfigurer configurer){
UrlPathHelper urlPathHelper = new UrlPathHelper();
urlPathHelper.setRemoveSemicolonContent(false);
configurer.setUrlPathHelper(urlPathHelper);
}
}
2.矩阵变量要生效 ,一定要有 路径变量
//http://localhost:8080/shell;low=zhangsan;
@RequestMapping("/{low}/{low2}")
@ResponseBody
public Map save(@MatrixVariable(value = "age",pathVar = "low") String low,
@MatrixVariable(value ="age",pathVar = "low2") String low2){
Map<String,Object> map = new HashMap<>();
map.put("low",low);
map.put("low2",low2);
return map;
}