| Author |
Set HTTP header value from struts action class
|
Sheelu sheelu
Greenhorn
Joined: Apr 28, 2011
Posts: 2
|
|
Hi
I'm trying to set the HTTP http header value from a struts action class. This is the code:
public ActionForward execute(ActionMapping aMapping, ActionForm aForm,
HttpServletRequest aRequest, HttpServletResponse aResponse)
throws Exception{
String userName = "test";
aResponse.addHeader("X-SCP-USERNAME", userName);
aResponse.setHeader("X-SCP-USERNAME", userName);
}
I verified this value being set by putting a breakpoint in the code, and I see this value is being set.
But, when I tried to access the value from another action class, I dont find this value being set. I used HttpFox to read the response from http header and I dont find the value there as well.
My target is to set a value in the http header so that a iframe in the page can read that value.
Thanks in advance,
Sheelu
|
 |
 |
|
|
subject: Set HTTP header value from struts action class
|
|
|