Spring MVC中的请求注解

如:
@GetMapping
@PostMapping
@DeleteMapping
。。。。。。等等
可以使用正则表达式来指定参数的格式

比如,以下是使用正则表达式来指定id是数字类型

@GetMapping("get/{id:\\d+}/result")
public void get(@PathVariable Long id) {
    
    
	log.error("id={}", id);
}

猜你喜欢

转载自blog.csdn.net/weixin_43871678/article/details/112184073
今日推荐