Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

filter across context

 
Tom Henricksen
Author
Ranch Hand
Posts: 144
5
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you setup a filter to go across different context or at a server level? Or is there another mechanism that could do this in EE java?
Thanks,
Tom
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the specific reason?

If it's authentication you're after, using container authentication (if that's appropriate) will work across all containers in the same J2EE instance.

In general though, I think the answer is probably no. Please be a bit more specific, I'm intrigued...
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't tried it myself, but I have been told that tomcat has a web.xml file in the same directory as server.xml. When tomcat starts up it applies this file to all applications. If you put a servlet filter reference in this file and have any code that it executes in the server classpath then you should have to install the filter everywhere. Also, if the filter has some static reference then all apps would see the same data too, so you should be able to do pretty much what you want with these capabilities (assuming you use tomcat).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic