简体   繁体   中英

Using multiple .war in one Web application

My company is creating multiple web applications that will have some overlap in functionality. I want to develop the common functions a separate project, and since it would consist of web pages and managed beans I would assume the project would need to be in its own .war file. I would then presumably deploy the two (or more) web applications inside of a .ear file. Doing some preliminary research online has left me unsure of how well the web applications would work together. Would I be able to share data between the managed beans and direct the user from pages inside of one web application to another? Is the the proper approach to making my application maintainable or is there some better way to break up the project?

It is an overkill, but :
you can split the functionality of your apps into DB, business logic and presentation /web/ tiers; The "overlapping" functionality can go to the business and DB tiers.
The web fronts will have to talk to the business layer via corba, REST/LESS, soap or alternatives depending on what connectors you have in tier 2 /business/;

see this diagram
or google 3 tier architecture for more info


My company had the same problem some years ago, they ended up deploying multiple apps /some business logic duplication was inevitable /

Now we reinvented the wheel by creating a common, open, business layer service tier which can be called via webservices and is accessible to other apps/scripts anywhere within the department;

Wrap all your WAR files in to EAR file. And put library file in EAR so that all WAR files can share.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM