4 Replies Latest reply on Apr 22, 2008 8:08 PM by Robert Stone

    Session or request scope?

    Robert Stone Newbie

      Coming from Spring MVC on my previous project I really hate to use session scope on my backing beans, but more and more, I found myself converting the beans to that just to get some values during ajaxSingle="true" types of events. I tried a4j:keepAlive but all I get is error message that "View state couldn't be restored".
      So the question - should I give up and revert to using the session scope? It would be interesting to find what's the general approach, or practice, how people are dealing with these issues?

        • 1. Re: Session or request scope?
          Sergey Smirnov Master

          on the level you define the problem, I can advice to try Seam Conversation scope

          • 2. Re: Session or request scope?
            Robert Stone Newbie

             

            "SergeySmirnov" wrote:
            on the level you define the problem, I can advice to try Seam Conversation scope

            Well it's pretty late into project and we are not using Seam. We have hibernate/spring/myfaces/facelets/a4j and each and every backing bean was defined in session scope (I came in project rather late) and that creates so much maintenance and accumulates so much stuff in the session that pages take forever to load, etc. etc. BTW no one replied to my previous post where I describe one of the lovely problems I get when I try to use two SelectOneMenu controls with complex model object and request scope. I also found out that commandLink doesn't work inside table widget when placed into request scope. So naturally I'm wondering - am I the only one having these problems and how people are dealing with these?

            • 3. Re: Session or request scope?
              Sergey Smirnov Master

               

              "bostone" wrote:
              BTW no one replied to my previous post where I describe one of the lovely problems ....

              This is not a surprise for me. If you want someone to spend several hours to understand what you meant and/or reproduce your case, I would like to suggest using the paid customer support. Asking questions on the public forum has some specific.

              • 4. Re: Session or request scope?
                Robert Stone Newbie

                 

                "SergeySmirnov" wrote:
                "bostone" wrote:
                BTW no one replied to my previous post where I describe one of the lovely problems ....

                This is not a surprise for me. If you want someone to spend several hours to understand what you meant and/or reproduce your case, I would like to suggest using the paid customer support. Asking questions on the public forum has some specific.


                Sergey, honestly, I'm not trying to take advantage of free labor. I have a pretty broad question because time and again I have to switch beans to the session scope especially when I use a4j ajaxSingle=true". I think I put a pretty good description to my case but to give you some idea - here's classic a4j sample that I modified to use request scope and complex model object. It's broken. I would really appreciate if you guys can give some suggestions after looking at the code. I am just trying to learn after all

                http://www.box.net/shared/q5dzl5f0o0

                Regards,

                Bob S.