2 Replies Latest reply on May 21, 2011 11:02 AM by rjevans2000

    JSF 2 View Scope

    rjevans2000

      Hi all,

       

      I have a project which uses the following: JSF 2, Richfaces 4, Spring 3, Hibernate.

       

      I am using to Spring to manage all of my services and backing beans but want some of these beans to be view scoped (request is too short and session is too long). My problem is that Spring does not have a view scope, it only has request and session scopes.

       

      I have read that in Richfaces 3 there was the @KeepAlive annotation which acheived the same as a view scope, but this seems to have been deprecated in Richfaces 4 in favour of JSF's own @ViewScoped annotation.

       

      If I'm not letting JSF manage my beans (i'm managing them with Spring), how can I achieve the behaviour of view scope in Richfaces 4?

       

      Thanks

        • 1. JSF 2 View Scope
          ilya_shaikovsky

          if you do not want to use JSF management and in Spring it not possible - no way RichFaces dropped that functionality because after it get implemented in standard it looks like just unnesessary duplication. And b.t.w. if even it be available why you can't allow JSF to manage the bean but decided to allow to do that RF? Just interesting where do you see problems with JSF.

           

           

          P.S. Weld conversation scope solves that as well. and CDI in general could be used in order to manage your context dependencies in standard and easy manner.

          • 2. JSF 2 View Scope
            rjevans2000

            I stumbled across this article which shows how to implement your own View scope - it worked for me!

             

            http://www.harezmi.com.tr/spring-view-scope-for-jsf-2-users/