For example, you have to control access to the file under the root directory:
First change $ TOMCAT_HOME / ROOT / Web-INF / Web.xml
1. Join between and web-app>
Entire Application Web-Resource-Name>
/ * url-pattern>
Web-Resource-Collection>
User role-name>
auth-constraint>
security-connectiont>
Basic auth-method>
Test Access Control realm-name>
login-config>
2. Then join in $ TOMCAT_HOME / CONF / TOMCAT-Users.xml
Roles' name and corresponding correspondence in web.xml