欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

获取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;
		}

 

相关标签: request response