Results 1 to 2 of 2
  1. #1
    niteangell21 is offline Member
    Join Date
    Sep 2010
    Rep Power

    Default 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?

  2. #2
    shnplr is offline Member
    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 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 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).


Similar Threads

  1. Help Reading certain Address locations from file.
    By kriogenic in forum Java Applets
    Replies: 7
    Last Post: 11-05-2010, 01:45 PM
  2. calling a jar file from within java application
    By robby14 in forum Advanced Java
    Replies: 3
    Last Post: 03-10-2010, 09:11 PM
  3. Apache Velocity template file and output locations
    By mjwoodford in forum New To Java
    Replies: 1
    Last Post: 10-05-2009, 04:59 PM
  4. Replies: 5
    Last Post: 08-25-2009, 09:43 AM
  5. Batch file to Run Java application
    By nitishlnt in forum Eclipse
    Replies: 1
    Last Post: 10-24-2008, 08:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts