This week's book giveaway is in the Java in General forum. We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line! See this thread for details.
Using global datasource in web-app DataSourceRealm
posted 4 years ago
I have a DataSource for a connection pool defined at the tomcat level (tomcat/conf/context.xml). In the context.xml configuration of one of my web-apps I have an authentication DataSourceRealm defined and I'd like it to use the global datasource to do the authentication, but that datasource is not bound in the web-app context and so it throws an error. I know I can move the realm configuration from the webapp to the conf/server.xml config, but I dont want it used for all my webapps; just one in particular. The way I see I have two options: create a separate virtual host (service) in conf/server.xml just for this one web-app; or just use a JDBCRealm instead. Are there other options?