I am using <auth-method> BASIC and when I surf to the protected page I get
no popup. It simply returns: 401 not authorized. However, whenb I use FORM
auth-method, it works fine.

Below is my web.xml file.

Dave Ford

<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
 <display-name>Training</display-name>
 <description>For Java Training Class</description>
 <welcome-file-list>
  <welcome-file>index.html</welcome-file>
 </welcome-file-list>
 <security-constraint>
  <web-resource-collection>
   <web-resource-name>Unnamed</web-resource-name>
   <url-pattern>/foo.html</url-pattern>
      <url-pattern>/products.jsp</url-pattern>
      <http-method>GET</http-method>
  </web-resource-collection>
  <auth-constraint>
   <role-name>users</role-name>
  </auth-constraint>
 </security-constraint>
 <login-config>
    <realm-name>Foobar</realm-name>
  <auth-method>FORM</auth-method>
    <form-login-config>
      <form-login-page>login.html</form-login-page>
      <form-error-page>login-error.html</form-error-page>
    </form-login-config>
 </login-config>
 <security-role>
  <description>Registered administrators of this app.</description>
  <role-name>users</role-name>
 </security-role>
</web-app>




Reply via email to