Sun Java System Web Server 7.0 Update 3 Developer's Guide to Java Web Applications

Security Elements

The security elements are as follows:

security-role-mapping Element

This element maps roles to users or groups in the currently active realm.

Subelements

The following table describes subelements for the security-role-mapping element.

Table A–7 security-role-mapping Subelements

Element  

Required  

Description  

role-name Element

only one 

Contains the role name 

principal-name Element

requires at least one principal-name or group-name

Contains a principal (user) name in the current realm 

group-name Element

requires at least one principal-name or group-name

Contains a group name in the current realm 

Attributes

none

servlet Element

This element specifies a principal name for a servlet, which is used for the run-as role defined in web.xml.

Subelements

The following table describes subelements for the servlet element.

Table A–8 servlet Subelements

Element 

Required 

Description 

servlet-name Element

only one 

Contains the name of a servlet, which is matched to a servlet-name in web.xml.

principal-name Element

only one 

Contains a principal (user) name in the current realm. 

Attributes

none

servlet-name Element

This element contains data that specifies the name of a servlet, which is matched to a servlet-name in web.xml. This name must be present in web.xml.

Subelements

none

Attributes

none

role-name Element

This element contains data that specifies the role-name in the security-role element of the web.xml file.

Subelements

none

Attributes

none

principal-name Element

This element contains data that specifies a principal (user) name in the current realm.

Subelements

none

Attributes

none

group-name Element

This element contains data that specifies a group name in the current realm.

Subelements

none

Attributes

none