简体   繁体   English

在Web应用程序中部署模块

[英]Deploying modules in a web application

I have a web application - deployed on Tomcat. 我有一个Web应用程序-部署在Tomcat上。

It has two modules Module A and Module B 它具有两个模块A和B

Both have java code as well as UI component (struts\\JSP etc.) 两者都有Java代码以及UI组件(struts \\ JSP等)

Functionally, Module A is independent an doesn't depend upon Module B For ModuleA: We create a war for Module A and deploy it as ModuleA.war 在功能上,模块A是独立的,并且不依赖于模块B。对于模块A:我们为模块A创建战争并将其部署为模块A。

Now Module B depends upon Module A We so "merge" the two modules into ModuleB.war This involves merging the web content directories into one 现在模块B依赖于模块A,因此我们将这两个模块“合并”到ModuleB.war中,这涉及将Web内容目录合并到一个

We were feeling uncomfortable with this whole process of merging and wondering if there is a smart way to do this ? 我们对合并的整个过程感到不自在,并且想知道是否有聪明的方法可以做到这一点? We are also considering putting all the web content in one of teh modules - say Module A and just keep the java code in ModuleB 我们也正在考虑将所有Web内容放入一个模块中-说模块A并将Java代码保留在ModuleB中

Any suggestions ? 有什么建议么 ?

This is one of the java problems. 这是Java问题之一。 Say you app A is the public website, say your app B is your admin, but uses same database, same bizlogic classes,etc. 假设您的应用A是公共网站,说您的应用B是您的管理员,但是使用相同的数据库,相同的bizlogic类等。 I found this problem all time. 我一直都发现这个问题。 My approach might help you. 我的方法可能会为您提供帮助。

module A will have classes related only to project A module B will have classes related only to project B mod A and B will share a .jar file who contains all related classes, you can deploy it in TOMCAT/lib or if you want maintain it individually, deploy it in each app MYAPP/WEB-INF/lib 模块A将具有仅与项目A相关的类模块B将具有仅与项目B相关的类mod A和B将共享一个包含所有相关类的.jar文件,您可以将其部署在TOMCAT / lib中,或者如果要对其进行维护分别将其部署在每个应用程序MYAPP / WEB-INF / lib中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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