Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 second servlet is actually runing on different context, hence I can't use dispatcher forward, hence i have used sendRedirect in first servlet with code 302.

SCENARIO:
When user clicks on submit button he/she is being redirected to a URL in another domain with parameters to authenticate the user.
Once the authentication is successful the URL through which second service received parameters is appended by custom headers post authentication and redirects back to it.
I am using Spring Webflow hence when this URL with headers gets redirected and hits my application then my frontendcontroller gets called in which i try to fetch the headers from request. Unfortunately i am not sure if i am missing something when try using request.getHeader("Header_Name") i do not get the value and NULL is returned.

Whereas on second service side all the headers are being sent correctly.

What I have tried:

When i enumerated all the header names being received in the redirected URL i am not able to see custom Header added in request URL.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900