spring boot不通过参数获取request/response的方法
方式一:
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
HttpServletRequest request = servletRequestAttributes.getRequest();
HttpServletResponse response = servletRequestAttributes.getResponse();
方式二:
@Autowired
private HttpServletRequest request;

浙公网安备 33010602011771号