Now when I log in to my initial servlet where I have been adding my "MyName" header , it sets header fine and my jsp which uses this header uses it correct ( as the value to the button and prints "Tester") .
But when I click on the button and the control goes to SessionTestServlet ( as it is submit button) , this header is lost.
Is there a way , in which i can set up a header in a initial servlet and it can be passed in all the subsequent request to the server ? As in my case "MyName" header is passed from my jsp to the next servlet .
Any leads would be very helpful.
Thanks
Aaki
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2407
posted
0
Headers are set for individual requests or responses; there is no way to keep them between requests (unless you have a special client that does so - web browser don't).
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12266
1
posted
1
Cookies are provided for the purpose of having the client browser add data to each request.
So isn't there any way in JSP ( i mean using some tags or other approach ) in which I can ask browser to send some header to servlet .
I mean as we know putting <META HTTP-EQUIV tag adds the following name to response header to be read by client . Is there any such tag which i can put so that client know that it has to send it to the servlet as header.
Thanks
Aaki
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Passing header in all subsequent HTTP Request