On our public facing web server we have an administration area for our website and is accessed by going to:
http://www.ourapplication.com/admin
The admin area has basic CRUD functionality and we have this built into our Java EE application, but we want to separate this admin area to a different server behind our firewall so that it is accessible from our internal network only.
What’s the best strategy for accomplishing this?
You can create one web application that really is a container for 2 separate applications. For example when I use ant and struts, when deploying a public facing site, I don’t even compile
example.actions.adminorexample.admin.*in my public facing site, though I choose what models I want to compile and share with this app. I also set up my properties file to connect to a different database etc.Then my admin app, deployed on an internal network, excludes the public actions as well. My setup is Struts specific, but I presume you can deploy different parts of your application to different servers while still using parts of the same shared codebase.
Actually I even have one app, that has a third app as part of it, a Java Webstart app that we launch from the admin app. It also shares the same models as the admin app.
From a code organization perspective, this is one Java application. However from an application perspective, these are actually 3 separate applications.
Now just because you can do something… it doesn’t really mean you should.
In my scenario, the very limited subset of classes we have in the public facing site is really all we need to build it. However without that caution, this trick could turn around and hurt you.