I have a REST API webservice which injects a singleton bean. This bean needs to know about the HTTPServletRequest. So i have created another bean called RequestServiceImpl which has HTTPServlerRequest injected.
public class RequestServiceImpl implements RequestService
{
@Autowired
private HttpServletRequest request;
}
web-context contains bean definition as
<bean id="requestService" class="com.RequestServiceImpl" scope="request">
<aop:scoped-proxy/>
</bean>
This requestService is injected into another singleton bean. I do see the requestservice bean being injected correctly but the HTTPServletRequest object is always null. I am not sure where am i going wrong