I know how to autowire a http request object in Java code:
@Resource
private HttpServletRequest request;
I want to do something similar in the xml conf. The bean I’m trying to instantiate takes a http session object as constructor argument:
<bean class="..." scope="request">
<constructor-arg>
???
</constructor-arg>
</bean>
You could create a factory class that uses this method:
http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/context/request/RequestContextHolder.html#currentRequestAttributes%28%29
E.g.:
And the Java: