title: redirect to http back after https in tomcat + jsf
body: <p>I have a login page that I would like to show in https. After validating the user, I would like to transfer him back to http.</p>
  
  <p>So I declared in web.xml</p>
  
  <pre><code>&lt;security-constraint&gt;
    &lt;web-resource-collection&gt;
     &lt;web-resource-name&gt;Login and Restricted Space URLs&lt;/web-resource-name&gt;
     &lt;url-pattern&gt;/general/enter.jsf&lt;/url-pattern&gt;
    &lt;/web-resource-collection&gt;  
    &lt;user-data-constraint&gt;
     &lt;transport-guarantee&gt;CONFIDENTIAL&lt;/transport-guarantee&gt;
    &lt;/user-data-constraint&gt;
   &lt;/security-constraint&gt;
  
   &lt;security-constraint&gt;
    &lt;web-resource-collection&gt;
     &lt;web-resource-name&gt;Rest of the Application&lt;/web-resource-name&gt;
     &lt;url-pattern&gt;/general/home.jsf&lt;/url-pattern&gt;
       &lt;/web-resource-collection&gt;
    &lt;user-data-constraint&gt;
     &lt;transport-guarantee&gt;NONE&lt;/transport-guarantee&gt;
    &lt;/user-data-constraint&gt;
   &lt;/security-constraint&gt;
  </code></pre>
  
  <p>and I see that the login page is in https.</p>
  
  <p>But in my action:</p>
  
  <pre><code>public String doLogin() throws Exception {
    ...
    User user = service.getUserByNameAndCompany(name, company);
    ......
                  return "/general/home.jsf";
   }
  </code></pre>
  
  <p>The bean redirects the user to </p>
  
  <blockquote>
    <p>https ://mycomputer:8443/MYProject/general/home.jsf</p>
  </blockquote>
  
  <p>and I would like it to be back </p>
  
  <blockquote>
    <p>http: //mycomputer:8080/MYProject/general/home.jsf</p>
  </blockquote>
  
  <p>How can I do it?</p>