File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes how to create a shared project/libs use by different web apps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "how to create a shared project/libs use by different web apps" Watch "how to create a shared project/libs use by different web apps" New topic
Author

how to create a shared project/libs use by different web apps

heng zhang
Greenhorn

Joined: Jul 12, 2010
Posts: 16
Hi,
I use eclipse/tomcat apache to create web apps.
I have webapp1 , webapp2. I found that webapp1 and webapp2 sometimes use the data from the same table. Some DAO objects are overlapped.
I wonder if i can create a common-dao project /lib that can be used by both webapp1,2 and future web apps based on the same database.

how can i create the share projects/libs. or is there any articles online available about this

Thanks
Heng
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31054
    
162

You can share libraries by adding them to the server classpath. However, i recommend you not do this. It is better to have the libraries deployed with each web application so you can upgrade them independently.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
heng zhang
Greenhorn

Joined: Jul 12, 2010
Posts: 16
You can share libraries by adding them to the server classpath.

do you mean i create a new project called common-dao, then implement Dao objects in this project and add this project to webapp1, webapp2 in the java build path?

It is better to have the libraries deployed with each web application so you can upgrade them independently.

do you mean even the common-dao projects can be shared by different projects, it's still worth implementing those DAOs in separate project, even though they are the pretty much the same?

what do you mean by upgrade? upgrade what?

Thanks
Heng
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to create a shared project/libs use by different web apps