title: Primefaces component not respond after the session expired
body: <p>I have a filter which checks the session. My filter:</p>
  
  <pre><code>public class FilterLogin implements Filter{
  
      FilterConfig fc;
  
      @Override
      public void init(FilterConfig filterConfig) throws ServletException {
          //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
          fc = filterConfig;
      }
  
      @Override
      public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
          //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  
          HttpServletRequest req = (HttpServletRequest) request;
          HttpServletResponse resp = (HttpServletResponse) response;
          HttpSession session = req.getSession(true);
  
          if (session.getAttribute("loginMB") == null) {
              resp.sendRedirect("/home.xhtml");
          } else {
              chain.doFilter(request, response);
          }  
      }
  
      @Override
      public void destroy() {
          //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
      }
  
  }
  </code></pre>
  
  <p>web.xml:</p>
  
  <pre><code>&lt;filter&gt;
      &lt;filter-name&gt;filter&lt;/filter-name&gt;
      &lt;filter-class&gt;pl.ePrzychodnia.filter.LoginFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;filter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/protected/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt; 
  &lt;error-page&gt;
      &lt;exception-type&gt;javax.faces.application.ViewExpiredException&lt;/exception-type&gt;
      &lt;location&gt;/home.xhtml&lt;/location&gt;
  &lt;/error-page&gt;
  </code></pre>
  
  <p>When the session is expired I should go to the site home.xhtml. But when the session is expired and I want click the navigation menu in the page, the component is not reacting to the click...
  When I do not use Primefaces everything works correctly. When I use primefaces in my project I have this error. What could be the cause?</p>
  
  <p>I try use a global exception handler but i have a little problem. I copy class from this site  <a href="http://wmarkito.wordpress.com/2012/04/05/adding-global-exception-handling-using-jsf-2-x-exceptionhandler/" rel="nofollow">http://wmarkito.wordpress.com/2012/04/05/adding-global-exception-handling-using-jsf-2-x-exceptionhandler/</a></p>
  
  <p>and edited in class CustomExceptionHandler:</p>
  
  <pre><code>try {
  
                  //log error ?
                  log.log(Level.SEVERE, "Critical Exception!", t);
  
                  //redirect error page
                  requestMap.put("exceptionMessage", t.getMessage());
                  nav.handleNavigation(fc, null, "/home");
                  fc.renderResponse();
  
                  // remove the comment below if you want to report the error in a jsf error message
                  //JsfUtil.addErrorMessage(t.getMessage());
  
              } 
  </code></pre>
  
  <p>I change: <code>nav.handleNavigation(fc, null, "/error");</code> to <code>nav.handleNavigation(fc, null, "/home");</code></p>
  
  <p>But when session timeout i not reditect to home.xhtml page only go to the page when I clicked and i have a example error: </p>
  
  <pre><code>SEVERE: Critical Exception!
  javax.faces.application.ViewExpiredException: viewId:/protected/admin/about.xhtml - View /protected/admin/about.xhtml could not be restored.
  </code></pre>
  
  <p>when i clicked reference to about page when my session expired. I see a incomplete about.xhtml page instead home.xhtml</p>