Let’s say I want to allow my developers to upload their war files to a web app (not the application server itself) running on our intranet and that web app would then run those wars as if they were separate apps deployed individually in our J2EE container.
In other words, we are not actually deploying the wars as separate apps in the container – they are simply running side-by-side inside this one web app that acts like a J2EE container.
Is that possible?
Something like a war virtualization app?
You could start creating
ClassLoader, expanding the.war, loading the classes and dispatching the request to your application to the right sub web app. That looks like re-inventing the wheel (given that the app. server does that already) and is probably very complicated.On the other side, this looks terribly similar to how
portletswork. Portlets are packaged into a.warfile and are then used by the portal. For instance, in Liferay portal, you can upload a portlet.warfrom the liferay portal (not the app. server itself). Liferay will then place the uploaded.warfile in the auto-deploy directory of the app. server which will then be deployed like a regular web app. Then there is the portlet bridge that dispatch the request from the portal to the right portlet web app, etc. It’s maybe worth having a closer look at that.I don’t know your requirements, but I would definitively try do keep it simple as such stuff can get really complicated. But you could:
.warfrom you application.warandweb.xmlto ensure that the context is something like/ParentApp/ChildApp.warto the auto-deploy folder and let the app. server deploy itThis will provide the illusion the you can deploy sub webapp from your parent webapp.