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 4323792
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:02:52+00:00 2026-05-21T09:02:52+00:00

I set up my web app as follows: <error-page> <exception-type>javax.faces.application.ViewExpiredException</exception-type> <location>/WEB-INF/include/viewExpired.html</location> </error-page> so that

  • 0

I set up my web app as follows:

 <error-page>
        <exception-type>javax.faces.application.ViewExpiredException</exception-type>
        <location>/WEB-INF/include/viewExpired.html</location>
</error-page>

so that the above error page be displayed when the viewExpiredException is thrown.

However, when I restart the server and submit an ajax request on an “left-open” page, the exception is thrown in the console and my error page is not displayed.

Here is that stack trace from the console:

javax.faces.application.ViewExpiredException: viewId:/contact.jsf - La vue /contact.jsf na pas pu être restaurée.
        at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:200)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
        at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:111)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:118)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
        at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:110)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:113)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jeanbaptistemartin.util.DisableUrlSessionFilter.doFilter(DisableUrlSessionFilter.java:70)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        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:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:662)

anyone has got any clue please?

Thanks in advance,
J.

  • 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-05-21T09:02:53+00:00Added an answer on May 21, 2026 at 9:02 am

    So you want to handle Ajax errors on the standard JSF 2.0 implementation? The standard JSF implementation doesn’t provide a ready-to-use component for this. In PrimeFaces for example, you could use <p:ajaxStatus> component for this. The JSF 2.0 specification however outlines the following in chapter 13.3.6.2:

    13.3.6.2 Handling Errors For All Ajax Requests

    The JavaScript API provides the jsf.ajax.addOnError function that can be used to register a JavaScript function that will be notified when an error occurs for any Ajax request/response. Refer to Section 14.4 “Registering Callback Functions” for more details. The jsf.ajax.addOnError function accepts a JavaScript function argument that will be
    notified when errors occur during any Ajax request/response cycle. [P1-start-event] The implementation must ensure the
    JavaScript function that is registered must be called in accordance with the errors outlined in Section TABLE 14-5
    “Errors”

    You can find here a blog of one of the Mojarra developers which contains basic examples how to show the ajax status. Here’s an extract of relevance:

    <h3> Status:</h3>
    <textarea id="statusArea" cols="40" rows="10" readonly="readonly" />
    

    A simple textarea, not even hooked
    into the backend server data model.

    Then in our javascript (for the demo,
    in a separately loaded file, though it
    could just as easily be in page) we
    have:

    var statusUpdate = function statusUpdate(data) {
        var statusArea = document.getElementById("statusArea");
        var text = statusArea.value;
        text = text + "Name: "+data.source.id;
        if (data.type === "event") {
            text = text +" Event: "+data.name+"\n";
        } else {  // otherwise, it's an error
            text = text + " Error: "+data.name+"\n";
        }
        statusArea.value = text;
    };
    
    // Setup the statusUpdate function to hear all events on the page
    jsf.ajax.addOnEvent(statusUpdate);
    jsf.ajax.addOnError(statusUpdate);
    

    You could it as well to redirect to an error page using JS.

    window.location = '/errors/500.xhtml';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a Silverlight app and VS set up a web app for testing
I'm stress testing a web app and have set up a windows test program
I'm making a Django web-app which allows a user to build up a set
I'm using Spring 3, and trying to set up a simple web-app using annotations
I used web browser component in my app for windows mobile... I set the
I've set up the Resque-web interface to work with my rails 3 app but
I was working for a mail app using MFMailComposeViewController. web page was loaded when
can i write a web-App in Tomcat and set it in deployment to act
I have set Mozilla Firefox as default browser and and MVC 2 web app
I traditionally deploy a set of web pages which allow for manual validation of

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.