title: Servlet filter redirect, url not changed
body: <p>I'm having a problem with my authentication filter. When the filter redirects to the login page, all the previous page (main page) is displayed in the login page.
  If I go to the login page manually it works fine.</p>
  <p>Here is my filter:</p>
  <pre><code>    HttpServletRequest req = (HttpServletRequest) request;
      HttpServletResponse res = (HttpServletResponse) response;
  
      HttpSession session = req.getSession(false);
      String loginURL = req.getContextPath() + SiteMap.LOGIN_CONTROLLER;
      boolean sessionCreated = session != null &amp;&amp; !session.isNew();
  
      if (sessionCreated) {
          chain.doFilter(request, response);
      } else {
          res.sendRedirect(loginURL);
      }
  </code></pre>
  <p>I also noted that when filter redirects to the login page the URL in browser bar stays the same. The main problem is that I get content from other page in the login page. I don't know where is the problem.</p>