Hi, Sireesh:
An EAR file (Entity Archive), is going to contain everything the Enterprise Application needs to run. That will include any EJBs, regular classes, HTML files, libraries, web-oriented definitions (like tag libs), and persistence code.
Already you can see a flaw in what I have written. We place all the web-oriented stuff (HTML,
Servlet classes, tag-libs, CSS, etc.) into a separate container called a .war (WAR file). We put the persistence code into its own jar (.har etc.). So, assuming the alternatives are "deploy code in separate container", versus "
within the ear file, have the packages as folders within the ear", then the contents of your EAR file would have all these neatly packaged WAR, HAR, etc. files, and there would be those class files. Packaging them up in their own container would make sense,
within the ear file.
If instead you are talking about a separate jar file
outside the ear file itself, I don't see a need for that either.