J2EE Java Blueprints package/directory structure: best practice for common code?

J

jsoftwaredev

I am working on several Java J2EE web applications using struts/
tomcat, and I have common Java code that I want to share between
multiple J2EE web apps.

Question: Is there a best practice for where common Java code should
be placed in the J2EE Java BluePrints package/directory structure?

http://java.sun.com/reference/blueprints/

Should this code be placed into a JAR file?

Or, is it OK to include the common source files as part of the build
for each app?

Would it make any sense to place the code under apps?

How about placing it in the root directory under src/java/com?

I'm just looking for ideas.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

I am working on several Java J2EE web applications using struts/
tomcat, and I have common Java code that I want to share between
multiple J2EE web apps.

Question: Is there a best practice for where common Java code should
be placed in the J2EE Java BluePrints package/directory structure?

http://java.sun.com/reference/blueprints/

Should this code be placed into a JAR file?

Or, is it OK to include the common source files as part of the build
for each app?

Would it make any sense to place the code under apps?

How about placing it in the root directory under src/java/com?

I have never studied those blueprints but you should put
the common code in a project of its own and build it to a jar
file that you distribute to your web app projects (and runtime
end up in WEB-INF/lib of all the war's).

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top