This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using classes from other modules in web.xml

 
Mark Wa
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, We've got an ear and some wars all set up, currently on of the wars contains "common" classes used by other modules. I would like to use one of these classes in the web.xml of the other modules, but my server will not publish when i try this.

The reason for this is that I would like to set up a SessionListener to monitor the number of active sessions. As I understand a single sessionListener would suffice for all modules?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark,
You can move the common classes to a separate project/jar and have each war refer to that. It's called a jar dependency and a common technique.
 
Nick White Ro
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another option, if you have multiple applications in the same container that use the same classes, you can package them in a JAR and put the JAR in the container's library folder.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a little study about SOA. Is a pattern to share apps communications, so you may have access to some class implementation without the need of code replication.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic