Spring MVC: How to use a request-scoped bean inside a spawned thread?
OK, by reading the code in SimpleThreadScope that comes with Spring I think you can create a SimpleInheritableThreadScope by using an InheritableThreadLocal instead. Then just use a bit of xml to register your custom scope: <bean class=”org.springframework.beans.factory.config.CustomScopeConfigurer”> <property name=”scopes”> <map> <entry key=”thread-inherited”> <bean class=”org.mael.spring.context.support.SimpleInheritableThreadScope”/> </entry> </map> </property> </bean> This means that when you create a … Read more