如何在 Spring Framework 的 POJO 类中获取 HttpServletRequest 对象?
public class SimplePOJO {
//Receive Request
ServletRequestAttributes servReq= (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
HttpServletRequest req = servReq.getRequest();
//Want to send HttpServletResponse
}
我们可以从同一个 POJO发送HttpServletResponse吗?像上面一样