The following deployment descriptor elements have optional realm or realm-name data subelements or attributes that override the domain’s default realm:
sun-application element in sun-application.xml
web-app element in web.xml
as-context element in sun-ejb-jar.xml
client-container element in sun-acc.xml
client-credential element in sun-acc.xml
If modules within an application specify conflicting realms, these are ignored. If present, the realm defined in sun-application.xml is used, otherwise the domain’s default realm is used.
For example, a realm is specified in sun-application.xml as follows:
<sun-application> ... <realm>ldap</realm> </sun-application>
For more information about the deployment descriptor files and elements, see Appendix A, Deployment Descriptor Files.