Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error during navigation

 
prathibha shiju
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i created a simple application in jsf for page navigation.with out building that works in tomcat. and i tried to run the war file in jboss .
and i got the following exception.
the folder structure if my war file is

meta-inf , web-inf ,firstpage.jsp , secondpage.jsp, index.jsp
| |
V V
manifest.mf application.xml,faces-config.xml,web.xml




javax.servlet.ServletException: viewId:/firstpage.jsf - View /firstpage.jsf could not be restored.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:249)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


root cause

javax.faces.application.ViewExpiredException: viewId:/firstpage.jsf - View /firstpage.jsf could not be restored.
com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:187)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

can anyone tell me, what i have to change to make that application running correctly.?

regards
prathibha
 
Dushyant Agarwal
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You can put your web.xml and faces-config.xml inside the web-inf folder and then deploy the application.

May be your session just timed out and your view got expired. Or the application may have got restarted and the client id for your previous view is not the same as the current view.

Also do not keep any jar files related with JSF inside the WEB-INF/lib as JBoss is equipped with inbuilt implementation of JBoss
[ January 31, 2008: Message edited by: Dushyant Agarwal ]
 
prathibha shiju
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
actually that web.xml,application.xml and faces-config.xml are inside web-inf only.what you saw was a typing problem.
still thats not working.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by prathibha shiju:
hi ,
actually that web.xml,application.xml and faces-config.xml are inside web-inf only.what you saw was a typing problem.
still thats not working.


Seems a problem with mappings in web.xml. Can you post that here?
 
prathibha shiju
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my web.xml:....

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

<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>

<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>


</web-app>




This is my faces-config.xml:..........

<faces-config>
<navigation-rule>
<from-view-id>firstpage.jsp</from-view-id>
<navigation-case>
<from-outcome>secondpage</from-outcome>
<to-view-id>secondpage.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>

please help me...
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing is, prefix the path with forward slash (/) in navigation rules:

For example:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic