Re: PropertyNotFoundException: Target Unreachable, identifier “” resolved to null
Splash › Forums › PrettyFaces Users › PropertyNotFoundException: Target Unreachable, identifier "" resolved to null › Re: PropertyNotFoundException: Target Unreachable, identifier “” resolved to null
The annotation you have to use to specify the scope of a bean depends on IoC container you are using to manage the bean. As the IoC container is responsible to manage the lifecycle of the bean instances, you must of cause use an annotation that the container understands.
* If you are using plain JSF and @ManagedBean, you have to choose JSF’s @RequestScoped.
* If you are using CDI with JSF, you have to use @Named and CDI’s @RequestScope (different package than the corresponding JSF annotation).
* If you are using JSF with Spring (as in your case), you have to use something like @Component and @Scope(“something”).
So it is correct that @RequestScoped doesn’t work for Spring beans.
There are typically ways to simulate the view scope with other IoC containers. With CDI for example you could use Seam Faces or MyFaces CODI which both provide an implementation of @ViewScoped.
I don’t know what the common pattern is to use the view scope in Spring applications. But there was a blog post by Cagatay Civici some time ago regarding this:
The post is very old. Perhaps there are easier ways to do this today.