Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using classes from other modules in web.xml

 
Mark Wa
Ranch Hand
Posts: 122
  • 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: 34071
331
Eclipse IDE Java VI Editor
  • 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
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic