title: JSP Tomcat security-constraint always fails
body: <p>I have the following in my web.xml</p>
  
  <pre><code>&lt;security-constraint&gt;
      &lt;web-resource-collection&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/web-resource-collection&gt;
      &lt;auth-constraint&gt;
          &lt;role-name&gt;rolename&lt;/role-name&gt;
      &lt;/auth-constraint&gt;
  &lt;/security-constraint&gt;
  &lt;login-config&gt;
      &lt;auth-method&gt;BASIC&lt;/auth-method&gt;
  &lt;/login-config&gt;
  &lt;security-role&gt;
      &lt;role-name&gt;rolename&lt;/role-name&gt;
  &lt;/security-role&gt;
  </code></pre>
  
  <p>And also have the following in my tomcat-users.xml file:</p>
  
  <pre><code>&lt;role rolename="rolename"/&gt;
  &lt;user username="username" password="password" roles="rolename"/&gt;
  </code></pre>
  
  <p>The Authentication Required dialogue box appears when I try to navigate to my localhost site, but even though I enter the correct credentials, the dialogue box just refreshes itself and nothing happens.</p>
  
  <p>Any reason why this isn't working? Doesn't seem as basic as the auth-method suggests.</p>