获取request和response
程序员文章站
2022-04-23 16:55:08
...
在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; }
上一篇: Maven 生命周期与插件
下一篇: java io(字符、字节流)基础