6 Replies Latest reply on Jul 7, 2006 9:35 AM by bjneuman

    Session scoped javabean problem

    bjneuman

      I've got a session scoped javabean that is not being "reused". A new one is created and put in session scope instead.


      @Name("RequisitionTabbedPaneBean")
      @Scope(ScopeType.SESSION)
      public class RequisitionTabbedPaneBean implements TabChangeListener {
      public RequisitionTabbedPaneBean() {
       System.out.println("Constructing RequisitionTabbedPaneBean");
       }
      ...
      


      Here's a piece of the JSF page:
      <t:panelTabbedPane id="requisitionTabbedPane" binding='#{RequisitionTabbedPaneBean.tabbedPane}' serverSideTabSwitch="true" width="100%" selectedIndex='#{RequisitionTabbedPaneBean.selectedTabIndex}'>


      But My ouput shows this at every request for that JSF page (two requests shown):
      Constructing RequisitionTabbedPaneBean
      Displaying page
      Constructing RequisitionTabbedPaneBean
      Displaying Page
      


      Any ideas? Thanks!

        • 1. Re: Session scoped javabean problem

          Are you sure you're not getting a new session each time (blocking cookies, or whatnot)? Just for kicks, what happens if you change your JavaBean to a SFSB?

          • 2. Re: Session scoped javabean problem

            Oh, and there may or may not be a problem with the server side state saving in the facelets version that ships with Seam 1.0.1.

            Try adding:

            <context-param>
             <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
             <param-value>client</param-value>
            </context-param>

            to web.xml and see if that helps. If so, DL the latest facelets.jar from https://facelets.dev.java.net/ and use that instead.

            • 3. Re: Session scoped javabean problem
              bjneuman

              Thanks for the response.
              I tried your suggestions and got the same results after making my bean a SFSB!
              By the way, I am using client side state saving, facelets 1.1.11, and Seam 1.0.1 on Tomcat 5.5.17 with embedded EJB3.0 container.

              • 4. Re: Session scoped javabean problem
                bjneuman

                ...and cookies are enabled.

                • 5. Re: Session scoped javabean problem

                  How are you creating your component? Do you have a managed-bean of the same name configured in faces-config.xml?

                  • 6. Re: Session scoped javabean problem
                    bjneuman

                    Not at this time. It was initially registered only in faces-config. Then I tried @Name then SFSB. Finally, I got rid of the bean alltogether. I was beginning to have suspicions that the problem had something to do with the tomahawk tabbed pane tag and its binding to one of the bean's properties. Unfortunately, time constraints have forced me to find an alternative solution: I am no longer using the tomahawk tabbed pane and its backing bean.
                    Thanks for all your help.