title: How to pass data in HTTP Header while redirecting a request in Java
body: <p>is it possible to pass some data in HTTP Header, while redirecting a request from one server to another.</p>
  
  <p>Here is my <strong>scenario</strong>,
  I have one generic filter, via which every request is passing.
  Now, based on some condition, I'm redirecting the request to some different server using the API  <code>objHttpServletResponse.sendRedirect(strURL)</code>.</p>
  
  <p>But, the issue is, when I'm setting some data in response header like <code>objHttpServletResponse.setHeader("Key", "Value");</code> That's not available in the redirected server.</p>
  
  <p>So, my questions are,</p>
  
  <p><strong>1. Is there any way to pass some data in header while redirecting a request?</strong></p>
  
  <p><strong>2. If not, what are the other possible ways to send some data while redirecting a request?</strong></p>
  
  <p><strong>Please Note:</strong> few other ways, like </p>
  
  <p><strong>using URL parameters:</strong> 
  <code>objHttpServletResponse.sendRedirect(strURL+"?param="+ strParamValue);</code></p>
  
  <p><strong>or</strong> </p>
  
  <p><strong>using session:</strong> 
  <code>HttpSession session = httpRequest.getSession();
  session.setAttribute("Key", "Value");</code></p>
  
  <p>is not what I'm expecting.</p>