In JSF, by default the state saving is server side.This means that with initial request made by the browser , the server saves the view root on ots side and sends an identifier in th response to the browser. This identifier is coming in the hidden field that you found. For the next request the browser would have to send this identifier to the server to help in request processing.
In client side state saving, instead of sending an identifier the whole view tree is sent to the browser. That is why the value part in that case gets bigger. This view tree has to be sent back to the server for the next request processing and so on. For futher info you should go to the JSF website. --Dushyant --- On Wed, 22/4/09, Alexey Koloskov <[email protected]> wrote: From: Alexey Koloskov <[email protected]> Subject: Re: How to set up server-side state saving method To: "MyFaces Discussion" <[email protected]> Date: Wednesday, 22 April, 2009, 8:21 PM Thank you Cagatay for your answer, indeed when setting state saving to client, generated response is as two times bigger than previous one. So ViewState hidden filed is renderer always but contains different size of information. Cagatay Civici wrote: > Can't remember what info probably view id, but in server state saving still > some information is saved. > > Try setting state saving to client, you'll see the difference in size of that > hidden input. > > On Wed, Apr 22, 2009 at 3:36 PM, Alexey Koloskov <[email protected] > <mailto:[email protected]>> wrote: > > Here is my web.xml > <display-name>firstJsf</display-name> > <welcome-file-list> > <welcome-file>/index.jsp</welcome-file> > </welcome-file-list> > > <context-param> > <param-name>javax.faces.STATE_SAVING_METHOD</param-name> > <param-value>server</param-value> > </context-param> > <context-param> > ><param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name> > <param-value>20</param-value> > </context-param> > <context-param> > ><param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name> > <param-value>true</param-value> > </context-param> > > <servlet> > <servlet-name>Faces Servlet</servlet-name> > <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> > <load-on-startup>1</load-on-startup> > </servlet> > <servlet-mapping> > <servlet-name>Faces Servlet</servlet-name> > <url-pattern>*.jsf</url-pattern> > </servlet-mapping> > > Cagatay Civici wrote: > > How do you specify it in web.xml, please post the context > param config. > > On Wed, Apr 22, 2009 at 2:48 PM, Alexey Koloskov > <[email protected] > <mailto:[email protected]> > <mailto:[email protected] > <mailto:[email protected]>>> wrote: > > Hello! > I'am new to MyFaces. I have written a simple program on jsf: > <h:form> > <h:inputText value="#{indexBean.name}"/> > <h:commandLink action="#{indexBean.submit}" > value="Submit"/> > <h:outputText value="#{indexBean.processedName}"/> > </h:form> > and specify javax.faces.STATE_SAVING_METHOD=server in web.xml > But html code of the rendered page contains: > <input type="hidden" name="javax.faces.ViewState" > id="javax.faces.ViewState" > >value="/0RL6JBt8cvqShFdUYKZJMFYhH3aK5oYI4toUZvNpTR+xCEIE1Uu9gLy21nZ6Z9tJC3z6WQ4pGdWJUwOkbTP+Q==" > /> > It looks like saving state on client, is it correct behavior or > I'm doing something wrong? > > PS. I use MyFaces 1.2.6 > > Thank you, > Alexey > > > > Now surf faster and smarter ! Check out the new Firefox 3 - Yahoo! Edition http://downloads.yahoo.com/in/firefox/

