GeeCON Prague 2014*
The moose likes Servlets and the fly likes Regarding request/response header processing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Regarding request/response header processing " Watch "Regarding request/response header processing " New topic
Author

Regarding request/response header processing

Dinesh Sarkar
Greenhorn

Joined: Aug 25, 2009
Posts: 2

Hi, I am working in a project where I have been asked to either add some new headers in request(HttpServletRequest) or set new headers in response and then in some other resource fetch the newly set header values.
Can anybody please suggest ?

Many Thanks in advance .


Dinesh
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
You cannot modify the request headers coming into you from the client (browser). However, you can modify and add headers in the response object.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

welcome to javaranch dinesh
Dinesh Sarkar
Greenhorn

Joined: Aug 25, 2009
Posts: 2
Thanks Bosun. Actually my idea was like that.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12791
    
    5
Take a look at the HttpServletRequestWrapper and Filter interfaces.

You can use a Filter to substitute a wrapped request to give the effect of modified request headers.

Bill
 
GeeCON Prague 2014
 
subject: Regarding request/response header processing