用到的以下注解:
@Controller | 处理 http 请求 | |
@RestController | Spring4 之后新加的注解,原来返回 json 需要 @ResponseBody 配合 @Controller | |
@RequestMapping | 配置 url |
@PathVariable | 获取 url 中的数据 |
@RequestParam | 获取请求参数的值 |
@GetMapping | 组合注解 |
@PathVariable 获取url 中的数据
有图注意书写格式。
传统的获取数据的格式。
结果。
设置默认属性。
输出结果。
@GetMapping()
未完待续...