Reputation: 1908
I'm working on an application that can get monolithic in size. I'd like to break the app up into modular web components, and package them together as needed.
For instance, let's say I have the following web projects:
web-app-main.WAR
web-app-feature-1.WAR
web-app-feature-2.WAR
web-app-main.WAR will contain all beans and pages that are common for any deployment. Now let's say I have a Client #1 that has paid for web-app-feature-1.WAR, and Client #2 paid for both. I'd like to have the following:
Client #1
EAR
web-app-main.WAR
web-app-feature-1.WAR
ejb-client1.JAR
Client #2
EAR
web-app-main.WAR
web-app-feature-1.WAR
web-app-feature-2.WAR
ejb-client2.JAR
I need both feature WARs to simply act as extensions to the main WAR. That would mean that any JSF navigation & pages, or controllers, session data, etc, would be available to either of the feature WARs, and vise-versa. Additionally, the whole issue of the context-root rises up.
As I understand it, what I want to accomplish is not possible. How would you solve this problem?
Upvotes: 2
Views: 1465
Reputation: 1109532
Indeed, this is not possible. You should actually not package the "features" (modules) as loose WARs, but as JARs which end up in /WEB-INF/lib
of the WARs. A WAR is namely supposed to represent an independently running web application.
For the proper project setup and configuration detail, head to this answer: Structure for multiple JSF projects with shared code.
Upvotes: 1