常用前后端交互-后端接受前端参数注解JAY.LIN 收录于 未分类 2024-10-18 约 104 字 预计阅读 1 分钟 目录 @RequestParam()@PathVariable@RequestPart()@RequestBody()常用前后端交互 后端接受前端参数注解@RequestParam()接收路径参数@PathVariable接收 路径中 / 后边的参数 例如 /1 后端路径就写 /{id} 然后通过这个注解接受@RequestPart()这个既可以接受路径参数 还能接收文件 接受表单参数@RequestBody()用于接收 json 数据 将 json 字符串转换成后端对应的实体类Please enable JavaScript to view the comments powered by Giscus.