Ok, I'm sure this can be done but I don't know how about to do this. I would immagine Spring has some nifty way to do this already that I don't know about which is why I'm posting before I try to code a solution.
Ok, I have two jndi data sources that "point" to two different databases in this web app. Depending on the context (http://blah.comapp/, http:blah.com/app/test/) I need the app to use a different database.
Basically our requirements are to have one codebase that switches between the training and production database as well as some UI changes. Based on the URL we know if the user is a production or training user and we need to act accordingly.
Any ideas on an elegant solution? Worst case is that we deploy two apps that are configured slightly differently (one for prod one for training) but use the same code base -- technically fulfilling our requirements -- in order to get the all important speed to market requirement done.
We're using Struts MVC -> Spring -> Hibernate
I'd appreciate any pointers on how to do this. I'm farily new to Spring but it has been a joy to use thus far. TIA.