| Author |
set header and getheader
|
Harish Yerneni
Ranch Hand
Joined: Sep 15, 2004
Posts: 94
|
|
I am trying to print the value of a header and getting a null value as the output. Any ideas? code: resp.setHeader("foo","baris"); String hvalue = req.getHeader("foo"); out.println("<br>foo value is"+ hvalue); output: foo value isnull
|
SCJP 1.4 | SCWCD 1.4 | SCJD (WIP)
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
|
Are you doing this in the same servlet ??
|
[My Blog]
All roads lead to JavaRanch
|
 |
Harish Yerneni
Ranch Hand
Joined: Sep 15, 2004
Posts: 94
|
|
|
yes
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
You are setting the header to the response. Ok. You are reading the request header. Ok. But the request header and the response header are different.
|
 |
Harish Yerneni
Ranch Hand
Joined: Sep 15, 2004
Posts: 94
|
|
Thanks Satou. I got it.
|
 |
 |
|
|
subject: set header and getheader
|
|
|