Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7745351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:59:36+00:00 2026-06-01T09:59:36+00:00

I have an application built using JSF1.2. I have a home page which has

  • 0

I have an application built using JSF1.2. I have a home page which has a set of command links. After I deploy the application , when open the home page and click on any of these menu links – I get the below exception. However if I navigate to other pages and come back to page and click on any of the links , the approperiate page is opening.

javax.faces.application.ViewExpiredException: viewId:/home/home.jsf –
View /home/home.jsf could not be restored.

web.xml has the below filter –

 <filter>
    <filter-name>Seam Filter</filter-name>
    <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
    <init-param>
      <param-name>createTempFiles</param-name>
      <param-value>false</param-value>
    </init-param>
    <init-param>
      <param-name>maxRequestSize</param-name>
      <param-value>100000</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>Seam Filter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>ERROR</dispatcher>
  </filter-mapping>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:59:38+00:00Added an answer on June 1, 2026 at 9:59 am

    That can happen if the page is actually loaded from browser’s cache, or if your web application is somewhere invalidating the session after the response of the very first request. Since the latter is a rather odd programming approach, I suspect that it’s just the browser cache. You’d need to create a filter to tell the browser to not cache the JSF requests. The filter should be mapped on <servlet-name> of the FacesServlet and do the following job in doFilter() method:

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        HttpServletResponse res = (HttpServletResponse) response;
        res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // HTTP 1.1.
        res.setHeader("Pragma", "no-cache"); // HTTP 1.0.
        res.setDateHeader("Expires", 0); // Proxies.
        chain.doFilter(request, response);
    }
    

    Don’t forget to clear the browser cache before testing the webapp with the new filter.

    See also:

    • Our ViewExpiredException tag wiki page

    Unrelated to the concrete problem, you’ve there a major design problem: you’re using command links to perform page-to-page navigation. There they are not for. Command links are to be used for form submits. You should be using <h:outputLink> or normal HTML <a> elements for page-to-page navigation. This way the pages will be bookmarkable, searchbot-indexable and the URL in browser address bar will not anymore be "one step behind". See also When should I use h:outputLink instead of h:commandLink?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application which is built from command line (ANT) using J2ME Polish.
I have an application, built using MVC, that produces a view which delivers summary
I have a small ajax application built with php. Using phpMyAdmin I have set
Here's a use case: I have a desktop application (built using Eclipse RCP) which
I have a web application built using jsp/servlets.The web application session is set to
I have a Windows Forms application built using the .NET 3.5 Framework which self
I have a web application built using Spring which contains some jobs. A typical
All, I have a PHP Web application built using Zend Framework and MVC with
I have an winforms application that was built using MVC. The controller is subscribing
I have a legacy VB6 application that was built using MSDE. As many client's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.