Hi,

 

I have been searching for a solution for two days now so I hope you are able
to help me out with the basics!

 

jdk1.6.0_21, Tomcat 6.0.29, myfaces-core-2.0.1, trinidad-2.0.0-alpha-2 (same
problem before Trinidad), IntelliJ 9

 

javax.faces.application.ViewExpiredException: /pages/login.xhtmlNo saved
view state could be found for the view identifier: /pages/login.xhtml

               at
org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor
.java:128)

               at
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:1
71)

               at
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

               at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)

               at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)

               at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)

               at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:233)

               at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)

               at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127
)

               at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102
)

               at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)

               at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

               at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)

               at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
11Protocol.java:588)

               at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

               at java.lang.Thread.run(Thread.java:619)

 

 

::: faces-config.xml :::

 

<faces-config xmlns="http://java.sun.com/xml/ns/javaee";

              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd";

              version="2.0">

 

    <managed-bean>

        <managed-bean-name>loginBean</managed-bean-name>

        <managed-bean-class>gpstracer.beans.LoginBean</managed-bean-class>

        <managed-bean-scope>session</managed-bean-scope>

    </managed-bean>

 

    <navigation-rule>

        <navigation-case>

            <from-outcome>login</from-outcome>

            <to-view-id>/pages/login.xhtml</to-view-id>

            <redirect/>

        </navigation-case>

        <navigation-case>

            <from-outcome>frontpage</from-outcome>

            <to-view-id>/pages/frontpage.xhtml</to-view-id>

            <redirect/>

        </navigation-case>

    </navigation-rule>

 

</faces-config>

 

 

::: web.xml :::

 

<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://java.sun.com/xml/ns/javaee";

           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";

           version="2.5">

 

               <!-- Context params -->

               <welcome-file-list>

                              <welcome-file>index.xhtml</welcome-file>

               </welcome-file-list>

 

    <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>

    <servlet-mapping>

        <servlet-name>Faces Servlet</servlet-name>

        <url-pattern>*.xhtml</url-pattern>

    </servlet-mapping>

</web-app>

 

 

::: login.xhtml :::

 

<html xmlns="http://www.w3.org/1999/xhtml";
xmlns:ui="http://java.sun.com/jsf/facelets";

      xmlns:h="http://java.sun.com/jsf/html";>

 

    <body>

    <h:form id="login"> 

        <h:inputText value="#{loginBean.username}"/>

        <h:inputText value="#{loginBean.password}"/>

        <h:commandButton action="#{loginBean.login}" value="next"/>       

    </h:form>

    </body>

</html>

 

::: LoginBean.java :::

 

public class LoginBean {

 

    private String username;

    private String password;

 

    public String login(){

        return "frontpage";

    }

..

..

 

I load the page by calling index.xhtml or
localhost:8080/faces/pages/login.xhtml.

 

Hope you can help with this one! Thanks a lot.

 

-MICAH

Reply via email to