Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Directory structure for a J2EE application.

 
Prince Manchanda
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a j2ee application that consists of the:
ejbs
jsps, images, html,
helper classes used both by the ejbs and the jsps
property files.
The application will be deployed as an EAR file that will contain the jar file and the war file.
I want to use ANT tool to automate the build and deploy of my application.
I want to know the ideal directory structure for keeping my code, property files and build scripts, both for the development machines and production machines.
Hope I am clear with my problem.
 
Sri Basavanahally
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What app server are you using ? Check out the app server's docs, it will have the info you need.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think the application server matters because you'll be creating .war/.jar/.ear files in any case (or the same structure but in exploded form).
TheServerSide has a thread titled "Writing a good build.xml" in case you're using Ant.
You could also take a look at how popular open source projects have organized their code.
 
Sri Basavanahally
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right. I was just pointing to one of many places to get that information...
 
Prince Manchanda
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks for help. We are planning to use the WAS. I will surely go through the docs. But my main concern or question infact is that of the directory structure prior to creating jars/wars/ears. e.g. say on the dev machines, where the developers are developing their code, need to deploy/redploy it.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doesn't websphere provide an assembly tool?
[ November 20, 2003: Message edited by: Pradeep Bhat ]
 
Bill Dudney
Author
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi P Manchanda,
I'd suggest taking a look at Maven. I've not used it myself but I've heard lots of really good stuff about it.
If you want a simpler solution the sample code from my blog on J2EE AntiPatterns has a decent directory layout (IMO of course). The sample code for the JSF talk also has a more comprehensive layout. Both examples also encorperate Cactus which is a great tool for doing in container testing, as well as XDoclet which is also very helpful for building j2ee apps...
Hope this helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic