aspose file tools*
The moose likes JSF and the fly likes STATE_SAVING_METHOD=server doesn't work but set to client it works Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "STATE_SAVING_METHOD=server doesn Watch "STATE_SAVING_METHOD=server doesn New topic
Author

STATE_SAVING_METHOD=server doesn't work but set to client it works

Thomas Neumann
Greenhorn

Joined: Apr 07, 2009
Posts: 1
Hello

I have a problem about the STATE_SAVING_METHOD: My test project works if the state is saved on the client. If the state saving is changed to server, the page can be loaded, I can enter text, but after the click on the button i get an error message:

javax.servlet.ServletException: viewId:/index.jsp - View /index.jsp could not be restored.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:323)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)

root cause

javax.faces.application.ViewExpiredException: viewId:/index.jsp - View /index.jsp could not be restored.
com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:184)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:102)
com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:107)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)

web.xml

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

<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>enable</param-value>
</context-param>

<filter>
<display-name>Richfaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>

<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>

<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>/faces/*</url-pattern>
</servlet-mapping>

<login-config>
<auth-method>BASIC</auth-method>
</login-config>

index.jsp

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<html>
<head>
<title>RichFaces Greeter</title>
</head>
<body>
<f:view>
<a4j:form>
<rich:panel header="RichFaces Greeter" style="width: 315px">
<hutputText value="Your name: " />
<h:inputText value="#{user.name}" >
<f:validateLength minimum="1" maximum="30" />
</h:inputText>

<a4j:commandButton value="Get greeting" reRender="greeting" />

<h:panelGroup id="greeting" >
<hutputText value="Hello, " rendered="#{not empty user.name}" />
<hutputText value="#{user.name}" />
<hutputText value="!" rendered="#{not empty user.name}" />
</h:panelGroup>
</rich:panel>
</a4j:form>
</f:view>
</body>
</html>

Can someone please help. thanks
Lukasz Kidala
Greenhorn

Joined: Oct 19, 2009
Posts: 1
I have the same problem...
Is there any solution for this?
Gabriel Andery
Greenhorn

Joined: Sep 25, 2012
Posts: 1
I know it's been 3 years, but I just came across this problem. Give a look at this: https://community.jboss.org/message/41811
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: STATE_SAVING_METHOD=server doesn't work but set to client it works