Forums Register Login

Servlet Header

+Pie Number of slices to send: Send


after 10 sec it redirect to C.jsp
but in C.jsp i get only null, please let me me why i get null ?

+Pie Number of slices to send: Send
Question is about servlets, not Websphere. Moving.
+Pie Number of slices to send: Send
In case of redirect new request will come to JSP so will lose anything you set in previous request. You can use request dispatcher to achive your goal.
+Pie Number of slices to send: Send
 

shivendra tripathi wrote:In case of redirect new request will come to JSP so will lose anything you set in previous request. You can use request dispatcher to achive your goal.




No you can't. anything set in Header is used by the Client browsers and is not to store values in the application. Its common misleading statement. The values set in response headers are no way available in subsequent request. This is not the way it works.
+Pie Number of slices to send: Send
I have never written anything about assessing response header by a resource in application. I am taking about passing request to other resource using RequestDispatcher and I dont see any issue with that.
+Pie Number of slices to send: Send

OP question is on request & response "headers" and not in request dispatchers.
+Pie Number of slices to send: Send
 


OP question is on request & response "headers" and not in request dispatchers.


Can you elaborate your comments. I didnt get that.
+Pie Number of slices to send: Send
 


No you can't. anything set in Header is used by the Client browsers and is not to store values in the application. Its common misleading statement. The values set in response headers are no way available in subsequent request. This is not the way it works.



you mean that name can be only which is in the below list

Cache-Control
Pragma
Connection
Retry-After
Expires
Location
WWW-Authenticate
Content-Encoding
Location
Refresh

if i missed out . please let me me know when can i find the full list ?
i get these information from http header

+Pie Number of slices to send: Send


you mean that name can be only which is in the below list



not necessarily , the headers that you have added might be used by Client Browsers if it can interpret it. But certainly not sent in the subsequent response.


if i missed out . please let me me know when can i find the full list ?



request getHeaderNames() should provide most of them.
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1928 times.
Similar Threads
Servlet Redirection
java.sql.SQLException: Parameter index out of range (5 > number of parameters, which is 4).
HttpClient just wont download a audio file
response.sendRedirect no executing
Connection Pooling
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:17:57.