title: Tomcat redirects to wrong url after logging in
body: <p>I'm having this problem with my web application, where I'm performing form based authentication through Tomcat and it redirects me to a logo image file instead of redirecting to the index.html file which contains that logo image...</p>
  
  <p>I'm going to:</p>
  
  <pre><code>http://localhost:8080/GenTreeUploader/Servlet
  </code></pre>
  
  <p>Then it gives me the login form and after logging in successfully, I'm not in that url I was going to, but I get redirected to:</p>
  
  <pre><code>http://localhost:8080/GenTreeUploader/images/gdia_logo.png
  </code></pre>
  
  <p>After I'm authenticated when I go to:</p>
  
  <pre><code>http://localhost:8080/GenTreeUploader/Servlet
  </code></pre>
  
  <p>I then get redirected tot he correct place and not the image file.</p>
  
  <p>I'm attaching my web.xml file:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
  
      &lt;!-- WELCOME FILE LIST --&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;/Servlet&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
      &lt;!-- Security --&gt;
  
      &lt;security-constraint&gt;
  
          &lt;web-resource-collection&gt;
              &lt;web-resource-name&gt;Wildcard means whole app requires authentication&lt;/web-resource-name&gt;
              &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
              &lt;http-method&gt;GET&lt;/http-method&gt;
              &lt;http-method&gt;POST&lt;/http-method&gt;
          &lt;/web-resource-collection&gt;
  
          &lt;auth-constraint&gt;
              &lt;role-name&gt;tomcat&lt;/role-name&gt;
          &lt;/auth-constraint&gt;
  
          &lt;user-data-constraint&gt;
              &lt;!-- transport-guarantee can be CONFIDENTIAL, INTEGRAL, or NONE --&gt;
              &lt;transport-guarantee&gt;NONE&lt;/transport-guarantee&gt;
          &lt;/user-data-constraint&gt;
      &lt;/security-constraint&gt;
  
      &lt;login-config&gt;
          &lt;auth-method&gt;FORM&lt;/auth-method&gt;
          &lt;form-login-config&gt;
              &lt;form-login-page&gt;/login.jsp&lt;/form-login-page&gt;
              &lt;form-error-page&gt;/error.html&lt;/form-error-page&gt;
          &lt;/form-login-config&gt;
      &lt;/login-config&gt;
  
       &lt;!-- Main Servlet --&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;GenTreeUploaderServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.ktu.gdia.presentation.web.GenTreeUploader&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;GenTreeUploaderServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/Servlet&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
  
      &lt;session-config&gt;
          &lt;session-timeout&gt;
              60
          &lt;/session-timeout&gt;
      &lt;/session-config&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Well? Any ideas why it doesn't work as expected? Thanks in advance.</p>