aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes sending values in Header using sendRedirect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "sending values in Header using sendRedirect" Watch "sending values in Header using sendRedirect" New topic
Author

sending values in Header using sendRedirect

vn us
Ranch Hand

Joined: Dec 27, 2002
Posts: 33
Can i set a Header say "NAME" as the header name and value is "MYNAME" in the response object
and call the response.sendRedirect( url ) and Can i access the same header ( "NAME" ) in the redirected url?
That is
response.setHeader("NAME","MYNAME");
response.sendRedirect("http://myhost/servlet/MyServlet");
After request reaching to MyServert, Can I get the value of "NAME" from the Header?

Thanks,
AVNUS
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
I've never tested this, You could setup you own test case and see. Let us know what the results are.


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Unlikely. You would have to rely on the client browser to copy your response headers into its next request. As far as I'm aware there is no requirement or reason for a client to do this.
- Peter
 
Consider Paul's rocket mass heater.
 
subject: sending values in Header using sendRedirect
 
Similar Threads
Is it possible to Pass Parameters from One domain to another Domain
sendRedirect(Url)
Scwcd doubt
unable to pass data in same package
Passing header parameters with the request