为什么要使用耳朵而不是战争? [英] Why use an ear instead of a war?

查看:139
本文介绍了为什么要使用耳朵而不是战争?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了这个这个与我的问题有些相关。但我遇到了这篇文章这表明EJB可以打包在war文件中。如果是这种情况,为什么需要耳朵?一个例子的解释将非常受欢迎。

I read this and this which are somewhat related to my question. But I came across this article that says that EJBs can be packaged in a war file. If this is the case, why is there a need for an ear? An explanation with an example will be highly appriciated.

推荐答案

使用EAR或WAR取决于您要部署它的服务器,您的应用程序以及您的个人首选项。从Java EE6开始,您可以将EJB与其他servlet,jsps等打包到WAR文件中(最终只能在java ee 6兼容服务器上部署Web应用程序)。如果您使用ejbs在单独的包中打包应用程序并单独使用war,如果您未在应用程序中使用java ee6的其他功能,则可以使用java ee 5服务器,您可以分离EJB和WAR的部署清楚地分离业务层(EJB)和视图(Servlet,JSP等)。

Using EAR or WAR depends on the server you want to deploy it, your application, and on your personal preferences. From Java EE6 you can package your EJBs together with other servlets, jsps etc into WAR file (you end up with web application which you can deploy only on java ee 6 compatible server). If you package your app the old way with ejbs in a separate package and war separately, you can use java ee 5 server if you haven't used other features of java ee6 within your application, you can separate the deployments of your EJBs and WARs to have a clear separation of your business layer (EJB) and your view (Servlets, JSP's etc).

这篇关于为什么要使用耳朵而不是战争?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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