标签:pre response return public static 信息 info res current
public class CurrentContextUtils {
/**
* 返回当前线程上下文request信息
*
* @return
*/
public static HttpServletRequest getCurrentRequestInfo() {
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
return servletRequestAttributes.getRequest();
}
/**
* 返回当前线程上下文response信息
*
* @return
*/
public static HttpServletResponse getCurrentResponseInfo() {
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
return servletRequestAttributes.getResponse();
}
}
标签:pre response return public static 信息 info res current
原文地址:https://www.cnblogs.com/ming-blogs/p/12754837.html