Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Developer's Guide

- Previous: How to Configure a Realm
- Next: Creating a Custom Realm

## How to Set a Realm for an Application or Module

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.

- Previous: How to Configure a Realm
- Next: Creating a Custom Realm

- © 2010, Oracle Corporation and/or its affiliates