本文介绍了EAR包结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个带有1个war文件的EAR(appWeb.war是我的web模块)和几个jar文件。
这些jar文件不是EJB。我们选择基于应用程序的逻辑分离创建不同的jar文件,如model.jar(包含所有模型类,DAO,DTO和hibernate文件),BO.jar(包含业务逻辑)等...

I am creating an EAR with 1 war file (appWeb.war is my web module) and several jar files.These jar files are NOT EJBs. We have choosen to create different jar files based on logical separation of application like the model.jar (containing all model classes, DAO, DTO and hibernate files), BO.jar (containing business logic)etc...

我想知道我的EAR的正确包装结构

I wanted to know the correct packaging structure for my EAR

application.ear
.
.
....lib (folder created by us)
    .
    .
    ...strus.jar
    ...spring3.jar (all the spring library files)
    ...BO.jar
    ...model.jar

我将appWeb.war作为Web模块添加到IDE中的EAR(RAD 7.5)
这在application.ear / META-INF / application.xml中创建了条目

I am adding appWeb.war as the web module to my EAR in the IDE (RAD 7.5)Which creates the entry in application.ear/META-INF/application.xml

环境细节:
应用服务器:Websphere app server 7.0
IDE :RAD 7.5
这是一个Struts 2,Spring 3和Hibernate 3.6应用程序

Environment details:App server: Websphere app server 7.0IDE: RAD 7.5 It's a Struts 2, Spring 3 and Hibernate 3.6 application

问题:
1.这种方法是否正确?特定于应用程序的jar文件保存在EAR中的哪个位置?
2.我们想将库文件移动到application.ear / lib文件夹。

Questions:1. Is this approach correct? Where does the application specific jar files kept in an EAR?2. We want to move the library files to application.ear/lib folder.

任何dierctions /帮助/最佳实践都将受到赞赏。

Any dierctions/help/best practices on this will be appreciated.

谢谢

推荐答案

您在上面列出的是可供选择的。文件夹名称(在本例中为lib)非常适合您,只要您从WAR文件的MANIFEST类路径设置中正确引用它即可。就个人而言,我更喜欢这个解决方案,因为它可以防止您修改容器设置并让您的文件分散在容器树中。我想,只是我的偏好。

The one you've outlined above is one of the choices available. The folder name -- in this case, "lib", is pretty much up to you, as long as you properly reference it from the MANIFEST classpath settings of the WAR file. Personally, I prefer that solution as it keeps you from tinkering with container settings and having your files "scattered" across the container tree. Just my preference, I guess.

对于IBM推荐的设置:

For IBM recommended settings:http://www-01.ibm.com/support/docview.wss?uid=swg27006159

来自社区:

这篇关于EAR包结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 00:37