Hi,

I want to use the BASIC authentication mechanism provided by tomcat3.2.1, but I 
failed.

In my web.xml file, I have written the following statements:
<servlet>
        <servlet-name>
            initServlet
        </servlet-name>
        <servlet-class>
            servletjsp.lifecycle.InitServlet
        </servlet-class
        <load-on-startup>
            -2147483646
      </load-on-startup>
 </servlet>
 
 <security-constraint>
  <web-resource-collection>
   <web-resource-name>initServlet</web-resource-name>
   <http-method>GET</http-method>
   <http-method>POST</http-method>
  </web-resource-collection>
  <auth-constraint>
   <role-name>role1</role-name>
  </auth-constraint>
 </security-constraint>

and I also have added one line into the tomcat-users.xml:
<user name="zouhua" password="zouhua" roles="role1" />

But when I sent a request to the initServlet, it responsed me with out any 
authentication form appearing. Did I miss some important things?

Best Regards
Zou Hua

Reply via email to