发布网友 发布时间:2022-04-20 04:57
共1个回答
热心网友 时间:2023-06-23 04:46
在你的hostA里manager的web.xml
<!--
Define
a
Security
Constraint
on
this
Application
-->
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire
Application</web-resource-name>
<url-pattern>/manager/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>your-role</role-name>
</auth-constraint>
</security-constraint>
<!--
Define
the
Login
Configuration
for
this
Application
-->
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Application</realm-name>
</login-config>
<!--
Security
roles
referenced
by
this
web
application
-->
<security-role>
<description>
The
role
that
is
required
to
log
in
to
the
Manager
Application
</description>
<role-name>your-role</role-name>
</security-role>
把your-role替换成你的tomcat-users.xml定义的用户就行了...