org.springframework.web.context.request.RequestContextHolder
org.springframework.web.context.request.RequestAttributes
org.springframework.web.context.request.ServletRequestAttributes
开启新线程之前,添加代码:
// 将RequestAttributes对象设置为子线程共享
ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(sra, true);
非原创,抄的