title: ViewExpiredException when i use @ViewScoped
body: <p>I have problem with my h:commandButton "Login": when I use @ViewScoped and push this button there is ViewExpiredException, but when I use @SessionScoped, there isn't any error.</p>
  
  <p>Stack Trace:</p>
  
  <pre><code>javax.faces.application.ViewExpiredException: /pages/register.xhtmlNo saved view state could be found for the view identifier: /pages/register.xhtml
  at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:132)
  at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
  at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
  at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at java.lang.Thread.run(Thread.java:724)
  </code></pre>
  
  <p>my page:</p>
  
  <pre><code>            &lt;h:form&gt;
                  &lt;h:panelGrid columns="2" &gt;
                      &lt;h:outputLabel value="Login:"/&gt;
                      &lt;h:inputText value="#{registerController.registerLog}"/&gt;
                      &lt;h:outputLabel value="#{msg.password}"/&gt;
                      &lt;h:inputSecret id="pass" value=""/&gt;
  
                      &lt;h:column/&gt;
                      &lt;h:commandButton value="Login" action="#{registerController.login}"/&gt; 
  
                  &lt;/h:panelGrid&gt; 
              &lt;/h:form&gt;
  </code></pre>
  
  <p>and this is my RegisterController class:</p>
  
  <pre><code>@ManagedBean
  @ViewScoped
  public class RegisterController {
  
  private String registerLog = "";
  private String registerPass = "";
  
  
  /**
   * Creates a new instance of RegisterController
   */
  public RegisterController() {
  }
  
  //getters, setters
  
  public String login(){
  
      return null;
  
  }
  </code></pre>