---
title: "web.xml basic验证"
author: "chenhongbinjs"
date: "2014-06-12T16:48:03Z"
tags: []
categories: ["Web前端"]
slug: "web-xml-basic"
draft: false
lastmod: "2014-06-12T16:48:03Z"
id: 2078864
url: "https://chenhongbinjs.iteye.com/blog/2078864"
---

&lt;login-config&gt;  
        &lt;auth-method&gt;BASIC&lt;/auth-method&gt;  
    &lt;/login-config&gt;  
    &lt;security-constraint&gt;  
        &lt;web-resource-collection&gt;  
            &lt;web-resource-name&gt;auth&lt;/web-resource-name&gt;  
            &lt;url-pattern&gt;/\*&lt;/url-pattern&gt;  
        &lt;/web-resource-collection&gt;  
        &lt;auth-constraint&gt;  
            &lt;role-name&gt;flowRole&lt;/role-name&gt;  
        &lt;/auth-constraint&gt;  
     &lt;/security-constraint&gt;  
     &lt;security-role&gt;  
       &lt;role-name&gt;flowRole&lt;/role-name&gt;  
     &lt;/security-role&gt;