If a user enters www.google.com in browser i need to intercept the user request using filter and send the reuest through my server and the same if the resoponse comes from the server i need to intercept the response and i want to add something in the response and send the response back to the client..
By using the servlet filter we can do this.But i don know how to redircect the user request to my application server..
Thats impossible. If you do that it will come under security violation :-)
If you were owning the www.google.com domain you could add an interceptor.
A simplest form of interceptor can be like,
suppose you have an application hosted on your server. You want to log all input requests and outgoing responses from your service.. You can add an interceptor to log the request and response without disturbing your service application.
I am not intercepting some others.This is the situation if i am entering google in my browser before it google reaches the server i need to forward that request to my proxy and send it to corresponding server.And again if the response comes from the server first it must come to my proxy server and then i need to add something in that response and send that to server..
This is the one that i want to do.Can you have any idea?
You'd have to modify your browser in some way. It's impossible to do this to a random person of your choosing without their permission. You can configure your browser to communicate through a proxy by modifying its settings. For example, in Firefox, go to [Preferences > Advanced > Network > Settings].