title: JSF and Filter redirection generate blank page
body: <p>This is driving me insane, is there any good way for redirecting JSF page from Filter?
  Here is my code in <code>doFilter()</code></p>
  
  <pre><code>       try {
  
              HttpServletRequest req = (HttpServletRequest) request;
              HttpServletResponse res = (HttpServletResponse) response;
              LoginAgent loginAgent = (LoginAgent) req.getSession().getAttribute("login");
  
              if (loginAgent == null || !loginAgent.isLoggedIn()) {
                  res.sendRedirect("requireslogin.xhtml");
              }
              else {
                  chain.doFilter(request, response);
              }
  </code></pre>
  
  <p>All I got is a blank page. I have tried other way but none works and I haven't met a good example on redirecting to another JSF page without involving too much work. </p>
  
  <p>Is there any workaround for this? Basically the filter is used for disabling anonymous user from reaching pages.</p>