Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple Struts apps: What can you reuse?

 
K Robert
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi! When running multiple Struts applications, if the same object/functionality can be identified across all of the apps, how do you decouple that from one of the frameworks to share among all of the apps?
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If all the web apps resides on same JVM inside a common server, then we can configure server to load a particular resource/object for all the web apps it host.
If you need to share resources between web application you must let the web container manage them, and put them in JNDI. The web application can then get the resources from a JNDI context very easily.
For Tomcat, This link shows how JNDI can be configured and this link explains the How context loaded by all the web apps.
 
K Robert
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All the apps would be on different servers(physically). So, if the resource/object can be used for all three, where would that reside?
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, that's tricky and my knowledge about such distributed resource sharing is minimum, still I think RMI can help you

If you want more good answer, asking this question in 'Distribute Java' will help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic