1. springmvc 的Controller 中 注入request 线程安全吗? 原理是什么?
2. springmvc 的Controller 中如下代码线程安全吗?
@Controller public class AController{ protected HttpServletRequest request; protected HttpServletResponse response; @ModelAttribute public void bindRequestObject(HttpServletRequest request, HttpServletResponse response) { this.request = request; this.response = response; } @RequestMapping("/test") public Result test(){ System.out.println(request.toString()); } }
原文地址:https://www.cnblogs.com/oliveryu/p/10710383.html
时间: 2024-10-13 02:17:54