这是我的代码,凭据无法在应用程序load.please上显示的弹出窗口中查看
tomcat-users.xml
<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users>
<role rolename="admin"/>
<user username="admin" password="admin" role="admin"/>
</tomcat-users>
的web.xml
<security-constraint>
<web-resource-collection>
<web-resource-name>Web Application</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
<security-role>
<role-name>admin</role-name>
</security-role>
此外,此应用程序部署在Heroku上,因此我可能也需要帮助
答案 0 :(得分:0)
确保代码未被注释。
同时添加以下行而不是&lt;角色rolename =“admin”/&gt;
&LT; role rolename =“admin-gui”/&gt;
&LT;角色rolename =“manager-gui”/&gt;
&LT; user username =“admin”password =“admin”role =“manager-gui,admin-gui”/&gt;
重新启动tomcat,然后检查