Lei Gao wrote:
Thanks Erik,
Very clear specified, then where generally you put your servlet/bean source code? Is that a good way for creating a sub directory called 'javasrc' or something?
I have re-attached this to the list in case it be helpful to others.
I have my current (real world) project directory structured like this:
myProjectName/
bin/
build.properties
build.xml
docs/
lib/
misc/
resources/
src/
com/
domain/
myProject/
...etc...
test/
com/
domain/
myProject/
...etc...
web/
some.jsp
other.jsp
more.jsp
some.css
WEB-INF/
web.xml
tld/
myProject-tld.xml
...etc...- The "bin" directory is only used by my IDE, eclipse. If I were not using Eclipse, I wouldn't have a "bin" directory.
- The build.properties and build.xml are my Ant files.
- If I write any documentation I will put it in the "doc" directory, but - I probably won't write any. Still, the Ant script will automatically put anything in the "doc" directory into the documentation directory in the final distributable.
- The "lib" directory contains any JAR dependencies used by my application that I need to compile. These JARs will be put in the WEB-INF/lib directory by my Ant file when I build the application.
- The "misc" directory contains temporary files that I'm using, such as files with SQL code or other scratchwork. My Ant build file does not use this directory when building the project at all.
- The "resources" directory contains any miscellaneous files that I do need for my project, and these are handled on a per-case basis by the Ant build script.
- The "src" directory is where all of my Java code is. The meat of the project. All of my servlets, beans, and plain old java objects go in here, in the package hierarchy.
- The "test" directory contains unit test code, and mirrors the regular package hierarchy so that my unit tests have default access to various class members in the actual codebase.
- The "web" directory contains JSP files and static files, as well as a WEB-INF directory which is copied to the actual WEB-INF of the webapp during deployment by the Ant build file.
As you can see, it's not very original. I gathered the layout from the Tomcat deployment guide, the XPetstore application, and "Java Development With Ant" by Erik Hatcher and Steve Loughran. I think it's pretty close to the recommended layout. But it works for me.
Erik
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

