何时使用EAR以及何时应用程序应在WAR中? [英] When is it appropriate to use an EAR and when should your apps be in WARs?

查看:87
本文介绍了何时使用EAR以及何时应用程序应在WAR中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在WebLogic服务器上有很多Spring Web应用程序,并且对于何时应该在EAR中进行WAR以及何时应该作为WAR存在而感到好奇。有时,WAR需要访问常见的逻辑JAR,但我不明白为什么当这些JAR可以打包到WAR中时需要进入EAR。

We have many Spring web applications to make on a WebLogic server and are curious about when WARs should go in an EAR and when they should just exist as WARs. Occassionally, the WARs will need to access common logic JARs, but I don't see why these would need to go into an EAR when they could just be packaged into the WARs.

根据我的理解,如果EAR中有多个WAR并且您需要修改其中一个WAR,则需要重新部署整个EAR以更新服务器。这将导致所有WAR反弹。但是,如果它们不在EAR中,我可以更新一个WAR,它将是唯一一个反弹的。

From what I understand, if several WARs are in an EAR and you need to modify one of those WARs, you need to redeploy the entire EAR to update the server. This will cause all of the WARs to bounce. If they weren't in an EAR, however, I could just update the one WAR and it would be the only one to bounce.

拥有100个不同的WAR有什么问题文件独立并使用打包的JAR和共享库(使用WebLogic)?

What's wrong with having 100 different WAR files standing alone and using packaged JARs and shared libraries (using WebLogic)?

感谢您的任何见解!

推荐答案

如果您拥有的只是WAR文件,则EAR的用途有限,仅用作WAR的部署容器。你可以通过这种方式在WAR之间共享JAR来节省一些臃肿,但这本身并不是非常引人注目。

If all you have is WAR files, then an EAR is of limited usefulness, serving only as a deployment container for your WARs. You can save a bit of bloat by sharing JARs between the WARs in this way, but that in itself is not hugely compelling.

然而,在处理时,EAR是必不可少的。完整的JavaEE / J2EE应用程序,它们使用WAR,EJB,JMS,JCA资源等。这些应用程序的组件之间的交互和依赖关系在EAR中更容易管理。

EARs are essential, however, when dealing with full JavaEE/J2EE applications, which use WARs, EJBs, JMS, JCA resources, etc. The interactions and dependencies between the components of these sort of applications is vastly easier to manage in an EAR.

但是如果您使用的是Weblogic for是一个WAR容器,那么您也可以使用像Tomcat或Jetty这样的vanilla servlet容器来获取Weblogic的所有功能。

But if all you're using Weblogic for is a WAR container, then you might as well use a vanilla servlet container like Tomcat or Jetty, for all the functional use you get out of Weblogic.

这篇关于何时使用EAR以及何时应用程序应在WAR中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆