title: Using Post when doing a sendRedirect
body: <p>I have a requirement that a jsf page needs to be launched from a custom thin client in user browser (thin client does a http post). Since the jsf page may be invoked multiple times, I use a jsp to redirect to the jsf page with params on url. In jsp I do a session invalidation. The jsp code is below:</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;%@page session="true" %&gt;
  
  &lt;%
  response.setHeader("Cache-Control", "no-cache");
  response.setHeader("Pragma", "no-cache");
  session.invalidate();
  
  String outcome = request.getParameter("outcome");
  
  
  String queryString = "outcome=" + outcome ;
  
  response.sendRedirect("./faces/MyPage.jspx?"  + queryString);
  
  
  %&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=windows-1252"&gt;&lt;/meta&gt;
      &lt;title&gt;title here&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My jsf page uses mutiple drop down items with autoSubmit enabled. I set the params on session when the form first inits and then use it from there when an action button is ultimately clicked by user. Following is the code I use to get the param in jsf backing bean constructor: </p>
  
  <pre><code>FacesContext ctx = getFacesContext();
  Map sessionState = ctx.getExternalContext().getSessionMap();
  outcome = (String)sessionState.get("outcome");
  if(outcome == null)  //if not on session, get from url
      outcome = (String)JSFUtils.getManagedBeanValue("param.outcome");
  </code></pre>
  
  <p>This way I can get the param even after multiple autoSubmits of drop downs. </p>
  
  <p>My problem is that I cannot have parameters show up on browser address bar. I need a way so that the parameters can be passed to the jsp page. I cannot post direct to jsp from thin client since I need the jsf page to have a new session each time the client launches user browser. This is imp due to the above code snippet on how I use params in the jsf page. </p>
  
  <p>Is there nay way to use a post when doing a sendRedirect so that I do not have to pass params on url? I cannot use forward since when an autoSubmit fires on jsf page, it causes the browser to refresh the jsp page instead. </p>
  
  <p>Is there any better way to handle the jsf page itself so that I don't have to rely on storing params on session between successive autoSubmit events?</p>