2

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?

John Manko
  • 1,828
  • 27
  • 51

1 Answers1

1

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.

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Thank you BalusC. That definitely points me in the right direction! – John Manko Sep 20 '12 at 18:59
  • I just want to report back. For those developing JSF apps, you can set the templates in your WAR projects, but then load client-specific pages from client JARs since JSF allow for loading of pages from any module. – John Manko May 13 '14 at 20:20