Hi there,
I need to install a filter(javax.servlet.Filter) that intercepts http requests to any web application installed in a web server...there is a way to make that???
I mean if client query http://server:port/webapp1/... or http://server:port/webapp2/... the filter has to be executed
Thanks in advance...
-
how to make a filter intercept request to all webapp in a server (5 messages)
- Posted by: Jorge Alberto
- Posted on: September 28 2005 13:35 EDT
Threaded Messages (5)
- Not that I know of by Jakob Jenkov on September 28 2005 13:51 EDT
- You should be able to with Tomcat by Brian Ross on September 28 2005 16:06 EDT
- You should be able to with Tomcat by Jorge Alberto on September 28 2005 17:42 EDT
- Probably but then you have 2 things to maintain by Brian Ross on September 29 2005 01:11 EDT
- Forgive me - just a test by Doan LyDuc on September 28 2005 22:23 EDT
- You should be able to with Tomcat by Jorge Alberto on September 28 2005 17:42 EDT
-
Not that I know of[ Go to top ]
- Posted by: Jakob Jenkov
- Posted on: September 28 2005 13:51 EDT
- in response to Jorge Alberto
I don't think that is possible using standard J2EE features. Perhaps your application / web server has some features for that? I think Jetty has, but they won't be standard functions, meaning they won't be portable across app/web servers.
Anyone else knows more about this? -
You should be able to with Tomcat[ Go to top ]
- Posted by: Brian Ross
- Posted on: September 28 2005 16:06 EDT
- in response to Jorge Alberto
In Tomcat, applications are configured by the global web.xml file followed by the app-specific one in WEB-INF. So, if you go to <TOMCAT_HOME>/conf/web.xml and add the following as the first child of the web-app element, it should work for all web apps:
<filter>
<filter-name>My Filter</filter-name>
<filter-class>blah.blah.filter.MyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>My Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> -
You should be able to with Tomcat[ Go to top ]
- Posted by: Jorge Alberto
- Posted on: September 28 2005 17:42 EDT
- in response to Brian Ross
But in production we are using WAS, there is a way?? :(
Thanks!! -
Probably but then you have 2 things to maintain[ Go to top ]
- Posted by: Brian Ross
- Posted on: September 29 2005 13:11 EDT
- in response to Jorge Alberto
I don't know WAS, but whatever you would have to do would be different than Tomcat.
You might be best off defining the filter in each application's web.xml individually, so that it will be portable. -
Forgive me - just a test[ Go to top ]
- Posted by: Doan LyDuc
- Posted on: September 28 2005 22:23 EDT
- in response to Brian Ross
Sorry all, this is just a test.