在spring MVC 中如何获取request和response 呢?
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
- if(ValueWidget.isNullOrEmpty(tVVideo)){
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
- logger.error("tVVideo is null:"+request.getRequestURL());
- return;
- }