Hi
F is correct.
As you can override the getHeader() method in your class to return a modified value of header.
public
String getHeader(String name) {
//get the request object and cast it
HttpServletRequest request = (HttpServletRequest)getRequest();
//if we are looking for the "username" request header
if("username".equals(name)) {
//loop through the cookies
Cookie[] cookies = request.getCookies();
//if cookies are null, then return null
if(null == cookies) {
return null;
}
for(int i=0; i < cookies.length; i++) {
//if the cookie's name is "username"
if("username".equals(cookies[i].getName())) {
//get its value and return it
String val = cookies[i].getValue();
return val;
}
}
}
//otherwise fall through to wrapped request object
return request.getHeader(name);
}
Using this you can return a new header altogether.