title: using basic tomcat authentication
body: <p>I have a small application for which I need to implement tomcat authentication. After digging the internet, I found out Realm is the solution. Also I got how to configure my tomcat-users.xml, server.xml and web.xml.
  but it is still not working.</p>
  
  <p>I added this code in my web.xml</p>
  
  <pre><code>&lt;security-constraint&gt;
      &lt;web-resource-collection&gt;
      &lt;web-resource-name&gt;hp&lt;/web-resource-name&gt;
      &lt;url-pattern&gt;/pages/bill.jsp&lt;/url-pattern&gt;
      &lt;/web-resource-collection&gt;
      &lt;auth-constraint&gt;
      &lt;role-name&gt;Admin&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;&gt;
       &lt;realm-name&gt;default&lt;/realm-name&gt;&gt;
   &lt;/login-config&gt;
  </code></pre>
  
  <p>at login-config, I am getting Element 'login-config' cannot have character [children], because the type's content type 
   is element-only.
  What can be the issue ?</p>