Tomcat设置类似IIS的访问密码
例如你要控制对ROOT目录下文件的访问:首先更改$TOMCAT_HOME/ROOT/WEB-INF/web.xml
1.在和之间加入
Entire Application
/*
<!-- NOTE: This role is not present in the default users file -->
user
<!-- Define the Login Configuration for this Application -->
BASIC
TEST ACCESS CONTROL
2.然后在$TOMCAT_HOME/conf/tomcat-users.xml中加入
roles的名字和web.xml中的相对应
在TOMCAT4.03中测试通过
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/374079/viewspace-131994/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/374079/viewspace-131994/