This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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).