Results 1 to 2 of 2
- 01-25-2011, 07:15 AM #1Member
- Join Date
- Sep 2010
- Rep Power
file locations in Java EE Application
Guys, I am taking this class in Enterprise Java and developing a project using NetBeans. But I am kinda confused because there are 2 folders (ejb and war).
So how do i find out which layer goes in which folder. For example where does the domain, service, business and presentation layer files go respectively?
I know business layers are created as EJB session beans and goes in ejb folder. and the presentation (JSP)goes in war folder. what about domain layers, service layer(factory and other implementation files) and struts files reside? in ejb or war folder?
Also are domain layers created as ejb's or pojo's?
- 05-07-2011, 06:46 PM #2Member
- Join Date
- May 2011
- Rep Power
I'd typically separate java and jsp source (some examples):
Using this naming is easy to build
.war with: **/actions/**, **/forms/** and
-ejb.jar with: **/model/**, **/ejb/**
and jsp (web) source:
(rename /src/jsp to /src/web if you want)
The key is when you package (e.g. using ant or maven) the files into:
1) .ear - contains your .war, -ejb.jar, (3rd_party_libraries*).jar, application.xml etc
2) .war - contains your jsp/resource xml files, java source (e.g. struts) and 3rd party libraries visible only to web/servlet container.
3) -ejb.jar - contains java source visible to both web/servlet container and ejb container (e.g. your model, ejbs etc)
The manifest.mf in your -ejb.jar can have a class-path: entry with the list of 3rd party jars packaged in your .ear.
struts.jar would typically go into your war
commons-lang.jar would typically go into your .ear and your -ejb.jar would contain a manifest.mf that includes: class-path: commons-lang.jar commons-logging.jar etc (separated by blank space - don't use a comma separator)
Any java class in -ejb.jar should NOT also be duplicated in your war (and vice-versa).
- java classes in -ejb.jar are visible to java classes in .war
- java classes in .war are not visible to java classes in -ejb.jar
Your domain layer would probably be pojo's (or whatever base class you extend)
Your ejb's typically contain business methods/logic managing transactions and invoking your data access layer (daos).
- By kriogenic in forum Java AppletsReplies: 7Last Post: 11-05-2010, 12:45 PM
- By robby14 in forum Advanced JavaReplies: 3Last Post: 03-10-2010, 08:11 PM
- By mjwoodford in forum New To JavaReplies: 1Last Post: 10-05-2009, 03:59 PM
- By Manfizy in forum New To JavaReplies: 5Last Post: 08-25-2009, 08:43 AM
- By nitishlnt in forum EclipseReplies: 1Last Post: 10-24-2008, 07:46 PM