I am making using of custom spring managed view scope bean within a JSF2 - Spring application. I want to inject the bean into a request scope bean. However it looks like I am getting a new instance of the custom view scope bean every time the request scope bean is called.
My view scope bean is as below
@Component("registration")
@Scope("view")
public class RegistrationBean implements Serializable
My request scope bean is as follows
@Component("registrationController")
@Scope("request")
public class RegistrationController implements Serializable
{
@Autowired(required=false)
@Qualifier("registration")
private RegistrationBean registration;
.....
}
If I make use of the view scope bean directly within my facelets, all my values are preserved. However if I access the same through my request scope bean the values don't get preserved.
Based on my research I can see examples where a JSF managed view scope bean injected into JSF managed request scope bean, however I could not find any instance of the above mentioned problem.
Any information in understanding this issue is much appreciated. Thanks in advance.