如何给tomcat加密,在线等待
首先在你的application的web.xml中下面的一段
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<!-- NOTE: This role is not present in the default users file -->
<role-name>manager</role-name>
</auth-constraint>
</security-constraint>
然后配置你的tomcat_home/conf/tomcat-users.xml加上
<user name="yourname" password="youpassword" roles="manager" />