この規則により、以下のものにフラグを立てます。
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>
...
< span class="indent"> < /span> < security-constraint>
<display-name>ThisConstraint</display-name>
< span class= "indent2"> < /span> < web-resource-collection>
<web-resource-name>adminResources</web-resource-name>
<url-pattern>/*</url-pattern>
<http-method>取得</http-method>
</web-resource-collection>
< span class= "indent2"> < /span> < 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> < セキュリティー・ロール>
<role-name>管理者</role-name>
</security-role>
< span class="indent"> < /span> < セキュリティー・ロール>
<role-name>スーパーユーザー</role-name>
</security-role>