views:

11

answers:

1

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() {}
}
+2  A: 

Yes, just autowire it

public class FooRequestAware {
      private @Autowired HttpServletRequest req;

      public final bar() {}
}
skaffman
Thank you!I've found this thread meanwhile:http://forum.springsource.org/showthread.php?t=76940
noinflection