[Tomcat 7.0.x]
I wonder why UserDatabaseRealm use always global JNDI:
==========
Context context = getServer().
getGlobalNamingContext();
database = (UserDatabase) context.lookup(resourceName);
=========
but DataSourceRealm is more flexible:
==========
if (localDataSource) {
context = ContextBindings.getClassLoader();
context = (Context) context.lookup("comp/env");
} else {
context = getServer().getGlobalNamingContext();
}
===========
Is it intentionally, for example for some security reason or it is open
improvement option for UserDatabaseRealm?