本文共 503 字,大约阅读时间需要 1 分钟。
在 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;
- }
转载地址:http://hmovx.baihongyu.com/