<security-constraint>
 <web-resource-collection>
  <web-resource-name>dd
  </web-resource-name>
  <url-pattern>
    /getServletConfig
   </url-pattern>
   <http-method>
    GET
   </http-method>
   <http-method>
    POST
   </http-method>
 </web-resource-collection>
 <auth-constraint>
  <role-name>
   yangjianjun
  </role-name>
 </auth-constraint>
</security-constraint>
<login-config>
 <auth-method>BASIC
 </auth-method>
 <realm-name>passwords
 </realm-name>
 <form-login-config>
   <form-login-page>
    /login.jsp
   </form-login-page>
   <form-error-page>
   /error.jsp
   </form-error-page>
 </form-login-config>
</login-config>

解决方案 »

  1.   

    <security-constraint>
     <web-resource-collection>
      <web-resource-name>dd
      </web-resource-name>
      <url-pattern>
        /getServletConfig
       </url-pattern>
       <http-method>
        GET
       </http-method>
       <http-method>
        POST
       </http-method>
     </web-resource-collection>
     <auth-constraint>
      <role-name>
       tomcat
      </role-name>
     </auth-constraint>
    <user-data-constraint>
    <transport-guarantee>
      CONFIDENTIAL
    </transport-guarantee>
    </user-data-constraint>
    </security-constraint>
    <login-config>
     <auth-method>BASIC
     </auth-method>
     <realm-name>passwords
     </realm-name>
     <form-login-config>
       <form-login-page>
        /login.jsp
       </form-login-page>
       <form-error-page>
       /error.jsp
       </form-error-page>
     </form-login-config>
    </login-config>
      

  2.   

    up本人一向慷慨大方,守信用,up 有分!
    欢迎讨论。
      

  3.   

    我说 的是https 访问
    那位大虾烁烁。。
      

  4.   

    关于这个问题我也曾想过,但没成功,IE是能够弹出了证书选择窗口,但却没有证书让你选:( 我也不知道为什么,文档上说就是一个clientAuth=true,是吧,我猜你也看到了。后来我在jboss的网上问,有人回是tomcat4.0不支持clientAuth特性???我也不知道是不是真的,因为没有官方证明。但我试tomcat4.0.3也不行。把你的研究进展与我共享一下吧,我们合许合计?
    我的MSN是 [email protected]
      

  5.   

    还有一个问题:<web-resource-name>与realm认证 的模式有什么区别和联系
    <web-resource-collection>
      <web-resource-name>dd
      </web-resource-name>
      <url-pattern>
        /getServletConfig
       </url-pattern>