이 규칙은 다음을 플래그 지정합니다.
auth-constraint
,
role-name
찾은 요소
해당 파일이 누락된 WEB-INF/web.xml 파일
security-role
요소.
Apache Tomcat 서버는
security-role
요소가 정의되어야 하지만,
Java EE 스펙은 이를 정의해야 함을 표시합니다.
이는 다음과 같은 예입니다.
auth-constraint
,
role-name
플래그 지정되는 요소:
< span class = "Code"> < web-app>
...
<보안 제약 조건>
<display-name>ThisConstraint</display-name>
<웹 리소스 컬렉션>
<web-resource-name>adminResources</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<description>관리자</description>
<role-name>관리자</role-name>
<role-name>슈퍼유저</role-name>
</auth-constraint>
</security-constraint>
</web-app>
둘 다
<role-name>admin</role-name>
및
<role-name>superuser</role-name>
행이 플래그 지정됩니다.
자동 수정은 누락된
security-role
요소.
이 예제에서는 자동화된 수정으로 구성에 다음 요소가 추가됩니다:
web.xml 파일:
< span class="Code"> < span class="indent"> < /span> < security-role>
<role-name>관리자</role-name>
</security-role>
<보안 역할>
<role-name>슈퍼유저</role-name>
</security-role>