tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: Why UserDatabaseRealm may use only resource from global JNDI but DataSourceRealm may use both global and local JNDI?
Date Mon, 20 May 2013 16:06:16 GMT
2013/5/18 outsider404 Gazeta.pl <outsider404@gazeta.pl>:
> [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?

I think it is just that nobody needed it. (From a quick look, I do not
see anything that prevents such a feature).

Feel free to prepare & test a patch.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message