here is my servlet :
public void doGet(HttpServletRequest request, HttpServletResponse response){
response.addHeader("name", "rahul");
response.setHeader("name", "rahul");
response.sendRedirect("/some.jsp");}
in my JSP :
<%
Enumeration e =request.getHeaderNames();
while(e.hasMoreElements()){
String header= String.valueOf(e.nextElement());
out.println("Header :" + e.nextElement()+ "<BR>");
out.println("Value : " + request.getHeader(header));
}%>
I am using livehttp header too to check the header.Output from live http
GET /StatusReturn/StatusFilterCode/WebContent/WEB-INF/jsp/final.jsp HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.8) Gecko/20071008 Firefox/2.0.0.8
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-securid
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: JSESSIONID=54411B48ED5F49AD57DE911CD31A839A
HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=4BCAE7B35828BE3426D0EAA075AE4B0C; Path=/
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 273
Date: Wed, 31 Oct 2007 23:35:24 GMT
[ October 31, 2007: Message edited by: Rahul Birdie ]