I'm assembling a somewhat simple webapp step by step. I have an authentication/authorization servlet filter along with the DelegatingFilterProxy. The process was working well until I tried to set up a session-scoped bean that is autowired into the filter and referenced from the resulting jsp.

I'm getting the following errors:
Error creating bean with name 'scopedTarget.bar': Scope 'session' is not active for the current thread ...
IllegalStateException: No thread-bound request found ...

I have two contexts, a WEB-INF/applicationContext.xml and WEB-INF/foo-servlet.xml where "foo" is the name for my DispatcherServlet.

Each of the contexts have a "component-scan" that cover exclusive packages, and the one in "foo-servlet.xml" has a "scoped-proxy" property with value "targetClass". In the package tree covering "foo-servlet.xml" I have a "Bar" class with the following annotations:

@Component("bar")
@Scope("session")

I'm not sure what I need to do.