Hi All,
How do you recommend I should structure a JSF application in terms of EARs, WARs and JARs?
Let me set the context for you: I have a fairly large project which consists of a number of sub components. Each of these sub components are JSF applications in the sense that they have JSF pages connected to each other. So, for instance, I have a company management sub component and a product management subcomponent. Most of these sub components share some Java libraries and/or entities.
Because of this I decided to have each sub component contained in its own WAR, with no universal libraries in its lib folder, and to then add these WARs to an EAR with all the library JARs in the EAR's lib folder, as so:
EAR
|_ component1.WAR
|_ component2.WAR
|_ lib
|_ sharedlib1.JAR
|_ sharedlib2.JAR
Unfortunately I'm having more problems than I hoped I would with JSF with this setup. An alternative I have is to create one gigantic WAR which contains all the library archives and then to only deploy this WAR. Although this would probably work, it destroys the nice seperation I had between sub components, where I could for instance just remove the one WAR from the EAR if it was giving problems. That structure would look something like this:
WAR
|_ <WebContent>
|_ WEB-INF
|_ classes
|_ <JSF classes>
|_ lib
|_ sharedlib1.JAR
|_ sharedlib2.JAR
Finally, I have a third option where I add all the libraries required by a WAR to its lib folder and I have no shared libraries in the EAR's lib folder. The disadvantages are of course that the EAR will be huge as JARs get duplicated unnecessarily, and I'm not sure that this won't cause conflicts. The structure would look like this:
EAR
|_ component1.WAR
|_ WEB-INF
|_ lib
|_ sharedlib1.JAR
|_ sharedlib2.JAR
|_ component2.WAR
|_ WEB-INF
|_ lib
|_ sharedlib1.JAR
|_ sharedlib2.JAR
I believe the first way to be the best, but I'm struggling getting JSF to work like I expect (see [http://forum.java.sun.com/thread.jspa?threadID=5288069|http://forum.java.sun.com/thread.jspa?threadID=5288069] ). What are your suggestions?
Thank you,
Ristretto