This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
s begri wrote:Hi every body ,
I have few questions :
What actually Filter do in a web application and how could we impliment it in our App ?
thanks and regards,
Filter is works like filter in real world, like water filter, it acts like interceptors.
If will seat between browser/client and your servlet. And it has access to ServletRequest and ServletResponse.
If you write filter, then you can modify this request , response using filter.
You can check all the request object and decide whether control should reach to destined servlet or not.
You can log time for a particular servlet has taken for responding.
Writing filter is similar to writing servlet. You have to configure it in web.xml.
filters are used to filter your request before it allows to your access your web resources.
you can custom your response too for filter.
filters are declared same like servlet in web.xml. filters are much like servelt.
Joined: Jun 03, 2009
Thanks every body .
Is there any good url avialable for Filter ?