...
- Create a
ThreadLocal
-based request and/or response holder class, similar to my old example. - Declare either a ServletRequestListener or Filter in web.xml to populate and clean up the ThreadLocal appropriately. A filter-based example is in my old project.
- Implement proxy classes for
HttpServletRequest
andHttpServletResponse
that just delegate all methods through to the request or response as obtained from the holder class. - Wire this proxy class to the beans that need it, using any of the above techniques:
- explicit dependency injection
- bean or bean factory post processors
- bean definition inheritance
- Java-based config
- etc
...
Auto-Adapting of non-Spring WebFlow Actions
The current notion of using OpenSAML profile actions which are Spring-independent is to wrap them in an Spring-dependent adaptor class. Instead of doing this declaratively in the beans configuration XML, this could be done auto-magically in a BeanPostProcessor
, allowing the beans XML to be simplified and contain only the declaration of the Spring-independent action bean.