Hi All,
Thanks for reading this post.
I would like to edit the http header varible in one servlet and redirect/forward to another servlet, in this second servlet I should be able to retrive the header variable using request.getHeader("MY_HEADER_INFO"). The following are the options I tried out
response.setHeader("MY_USER","GAUTHAM");
request.getRequestDispatcher("manager/index.jsp").forward(request,response)
response.setHeader("MY_USER","GAUTHAM");
response.sendRedirect("manager/index.jsp");
Please share any thoughts in this regard.
Thanks
Gautham
-
Edit HTTP header vairable and redirect (4 messages)
- Posted by: Gautham GV
- Posted on: June 07 2005 21:24 EDT
Threaded Messages (4)
- Edit HTTP header vairable and redirect by Marina Prikaschikova on June 08 2005 01:41 EDT
- Edit HTTP header vairable and redirect by Gautham GV on June 08 2005 18:01 EDT
- Do you have a web server? by Biswa Das on June 08 2005 20:37 EDT
- dasexpress@hotmail.com by Biswa Das on June 08 2005 20:40 EDT
-
Edit HTTP header vairable and redirect[ Go to top ]
- Posted by: Marina Prikaschikova
- Posted on: June 08 2005 01:41 EDT
- in response to Gautham GV
Use the first option (forward). Also you can use a filter instead of the first servlet.
Marina
http://www.servletsuite.com -
Edit HTTP header vairable and redirect[ Go to top ]
- Posted by: Gautham GV
- Posted on: June 08 2005 18:01 EDT
- in response to Marina Prikaschikova
Thanks for the reply Marina,
The second servlet is actually runing on different context, hence I can't use dispatcher forward.I am sorry I didn't specify this earlier.
Regards,
Gautham
www.satyam.com -
Do you have a web server?[ Go to top ]
- Posted by: Biswa Das
- Posted on: June 08 2005 20:37 EDT
- in response to Gautham GV
Browser has no obligations to return the header to context 2 you set in response object of context 1.
If you do not have a limitation of using request header I suggest you to go for a cookie based implementation.
Other wise you have to be smart enough of handling the request header in Apache/Iplanet in case you have.
If you need help on how to manipulate header in Apache I will be able to help you out. Other webservers are beyond my reach. -
dasexpress@hotmail.com[ Go to top ]
- Posted by: Biswa Das
- Posted on: June 08 2005 20:40 EDT
- in response to Biswa Das
reach me at dasexpress@hotmail.com