设置一
<?xml version='1.0' encoding='utf-8'?> <tomcat-users> <role rolename="tomcat"/> <role rolename="role1"/> <role rolename="manager"/> <role rolename="admin"/> <user username="tomcat" password="tomcat" roles="tomcat"/> <user username="role1" password="tomcat" roles="role1"/> <user username="both" password="tomcat" roles="tomcat,role1"/> <user username="admin" password="" roles="admin,manager"/> </tomcat-users>
如果设置不成功 可以尝试下面一种方式
<?xml version='1.0' encoding='utf-8?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/><role rolename="manager"/><role rolename="admin"/><role rolename="admin-gui"/><role rolename="admin-script"/><role rolename="manager-gui"/><role rolename="manager-script"/><role rolename="manager-jmx"/><role rolename="manager-status"/> <user username="tomcat" password="tomcat" roles="admin,manager,role1,tomcat,admin-gui,admin-script,manager-gui,manager-script,manager-jmx,manager-status" /></tomcat-users>