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 FooRequestAware {
private final Request req;
public final bar() {}
}
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 FooRequestAware {
private final Request req;
public final bar() {}
}
Yes, just autowire it
public class FooRequestAware {
private @Autowired HttpServletRequest req;
public final bar() {}
}