title: How to get Images and CSS shown in login/error files for Tomcat authentication
body: <p>I have Tomcat authentication for my web app and my problem is that the login.jsp and error.html files used as login and error forms don't seem to support styling or images. I've tried getting the path of the files and they're showing that they're in the correct path, so I don't get it why they dont' support images or CSS? Any ideas how to enable css for this?</p>
  
  <p>Edit:</p>
  
  <p>Well I tested in the following manner, if I try to access a secure path and will get redirected to login.jsp which is in</p>
  
  <pre><code>D:\Dropbox\EclipseWorkspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp7\wtpwebapps\GenTreeUploader\
  </code></pre>
  
  <p>In the same directory where the login.jsp is there is index.html. and if I access it directly it also opens and it shows that it's in the same directory as for the login.jsp. Now the differences are that for index.html css and images work and for login.jsp they don't, the files have basically the same templates for styles. The directory is the same as Web Content as shown in the pic below:</p>
  
  <p><img src="https://i.stack.imgur.com/23xPg.png" alt="enter image description here"></p>
  
  <p>My login.jsp has this code in it:</p>
  
  <pre><code> &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;HEAD&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;TITLE&gt;GenTreeFromWord (GDIA) &lt;/TITLE&gt;
          &lt;link rel="stylesheet" href="bootstrap/css/bootstrap.css"&gt;
      &lt;/HEAD&gt;
      &lt;BODY&gt;
  
          &lt;div class="navbar"&gt;
              &lt;div class="navbar-inner"&gt;
                  &lt;div class="container"&gt; &lt;a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;/a&gt; &lt;a class="brand" href="#"&gt;&lt;img src="images/gdia_logo.png" width="111" height="30" alt="GDIA logo" /&gt;&lt;/a&gt;
                      &lt;div class="nav-collapse"&gt;
                          &lt;ul class="nav"&gt;
                              &lt;li&gt;&lt;a href="/GenTreeUploader/Servlet?action=backToGmis"&gt;Go back to GMIS&lt;/a&gt;&lt;/li&gt;
                              &lt;li class="active"&gt;&lt;a href="/GenTreeUploader/Servlet?action=home"&gt;GenTreeFromWord (GDIA)&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="/GenTreeUploader/Servlet?action=contact"&gt;Contact&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="/GenTreeUploader/Servlet?action=about"&gt;About&lt;/a&gt;&lt;/li&gt;
                          &lt;/ul&gt;
                      &lt;/div&gt;
                      &lt;!--/.nav-collapse --&gt; 
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="container-fluid"&gt;
              &lt;div class="row-fluid"&gt;
                  &lt;div class="span1"&gt;
  
  
                  &lt;/div&gt;
  
                  &lt;div class="span10"&gt;                   
                      &lt;!-- Old page body with scriptlets --&gt;
                      &lt;h1&gt; 
                          &lt;center&gt;Welcome to GDIA&lt;center&gt;
  
                          &lt;% System.out.println(request.getRealPath("/")); %&gt;
  
                          &lt;%
  
                          String url = ((HttpServletRequest)request).getRequestURL().toString();
                          String queryString = ((HttpServletRequest)request).getQueryString();
  
                          System.out.println(url + "?" + queryString);
  
                          %&gt;
  
                      &lt;/h1&gt;
  
                      &lt;p&gt; 
  
                      &lt;!--  login body start --&gt;
                      &lt;div class="span4"&gt;&lt;/div&gt;
  
  
  
  
                      &lt;div class="row-fluid container span4"&gt;
  
                          &lt;form class="form-signin" name="credentials" action="j_security_check" method="post"&gt;
                              &lt;h4 class="form-signin-heading"&gt;Please sign in&lt;/h4&gt;
                                &lt;input type="text" name="j_username" class="input-block-level" placeholder="Username" tabindex="1"&gt;
                                  &lt;input type="password" name="j_password" class="input-block-level" placeholder="Password" tabindex="2"&gt;
                              &lt;button class="btn btn-large btn-primary" type="submit" value="Login" tabindex="3"&gt;Sign in&lt;/button&gt;
  
                               &lt;br&gt;&lt;br&gt;
                          &lt;/form&gt;
  
                      &lt;/div&gt;
  
                      &lt;div class="span4"&gt;&lt;/div&gt;
                          &lt;!-- login body end --&gt;
  
  
                      &lt;/p&gt;
                      &lt;!-- Body ends here --&gt;
                  &lt;/div&gt;
  
                  &lt;div class="span1"&gt;
  
  
                  &lt;/div&gt;
  
  
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>