If you have registered a realm named xyz via the admin console then in your web.xml under the login-config you can specify the name of the realm.
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>xyz</realm-name>
</login-config>
[Message sent by forum member 'kumarjayanti' (kumarjayanti)]
http://forums.java.net/jive/thread.jspa?messageID=288919