Using JSP to write Custom HTTP Headers
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Friday, July 2, 2010 03:39 AM

Hi I am trying to build a simple application which will allow me to simulate a Single Sign On service which will be incorporated into an application that we are developing (the SSO service is not available yet so I need to stub it). Essentially the SSO service will write some custom HTTP headers into any pages that are served; these can then be obtained and used to check user roles etc they are all of the form SSO_Username, SSO_Fullname etc. I have created Page1.jsp which contains a form which is POSTed to Page2.jsp, the form on Page1.jsp contains fields which will allow me to type in a value for SSO_Username etc. I would like to POST the form and then for the form's variables to be read and added as custom HTTP Headers whi   More>>

Hi



I am trying to build a simple application which will allow me to simulate a Single Sign On service which will be incorporated into an application that we are developing (the SSO service is not available yet so I need to stub it).



Essentially the SSO service will write some custom HTTP headers into any pages that are served; these can then be obtained and used to check user roles etc they are all of the form SSO_Username, SSO_Fullname etc.



I have created Page1.jsp which contains a form which is POSTed to Page2.jsp, the form on Page1.jsp contains fields which will allow me to type in a value for SSO_Username etc. I would like to POST the form and then for the form's variables to be read and added as custom HTTP Headers which are output with the Response on Page2.jsp which simply prints the headers and values on the screen



I know that data can be passed between the two pages in a number of ways using sessions, attributes etc but I need to prove that this works using HTTP Headers



I am able to POST the form and display the usual headers easily enough but am unable to write my own headers in. I have tried to use a Servlet Filter on Tomcat and have also tried to set the headers at the top of Page2.jsp but have had no success.



I am fairly inexperienced with JSP / Servlets so I am confident that there is something simple that I have misunderstood, has anybody got any suggestions on how this could be achieved?



Thanks Andy

   <<Less
About | Sitemap | Contact