随笔分类 -  SpringMVC

摘要:ResponseEntity ResponseEntity实现Rest风格的返回值 ResponseEntity 它是Spring提供的一个类,它内部封装了状态码,请求头,请求体等信息,用户可以根据自己的需要修改状态码、请求体的信息。ResponseEntity中的泛型用于指定请求体的类型,它的请求 阅读全文
posted @ 2020-08-24 05:31 silence022
摘要:@RequestMapping("/download") public String download2(String fileName, HttpServletRequest request, HttpServletResponse response){ FileInputStream fis = 阅读全文
posted @ 2020-07-29 21:43 silence022
摘要:请求参数的绑定 @PathVariable 获取url中的参数 @PostMapping("/test3/{id}") public ResponseEntity<String> test3(@PathVariable String id) { return ResponseEntity.ok("o 阅读全文
posted @ 2020-07-18 09:09 silence022