1 Reply Latest reply on Jul 18, 2011 1:55 AM by Mark Paluch

    can numberOfViews be changed at runtime

    Dave Chen Master

         <context-param>

            <param-name>com.sun.faces.numberOfViewsInSession</param-name>

            <param-value>2</param-value>

         </context-param>

        

         <context-param>

            <param-name>com.sun.faces.numberOfLogicalViews</param-name>

            <param-value>2</param-value>

         </context-param>

       

       

      can these two parameters be changed at runtime? or configured for each http session?

      Users may have different needs of views to go back, and we like user to configure it at runtime.

       

      Thanks,

      Dave

        • 1. Re: can numberOfViews be changed at runtime
          Mark Paluch Master

          Hi Dave,

          if you use Mojarra, take a look at com.sun.faces.renderkit.ServerSideStateHelper. This class stores the numberOfViews. There should be a LRUMap (com.sun.faces.util.LRUMap)  in your session (com.sun.faces.renderkit.ServerSideStateHelper.LogicalViewMap). When you want to change the number of views, try to get and modify the ServerSideStateHelper and shift contents from the old LRUMap to a new LRUMap which is sized to your new numberOfViews.

           

          Best regards,

          Mark