The following deployment descriptor elements have optional realm or realm-name data subelements or attributes that override the domain’s default realm:
web-app element in web.xml
as-context element in sun-ejb-jar.xml
For more information about the deployment descriptor files and elements, see Appendix A, Deployment Descriptor Files, in Sun GlassFish Enterprise Server v3 Prelude Application Deployment Guide.