Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
heng zhang
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
heng zhang
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic