I have a bean declared to be scope="request". is there a chance to obtain the request being used in that scope?
<bean class="FooRequestAware" scope="request"/>
class Fo开发者_如何学GooRequestAware {
private final Request req;
public final bar() {}
}
Yes, just autowire it
public class FooRequestAware {
private @Autowired HttpServletRequest req;
public final bar() {}
}
精彩评论