title: JSF redirects from HTTPS to HTTP
body: <p>I have my application on a test server being executed exclusively over https. When I navigate without redirecting, it works perfectly:</p>
  
  <p>Example:</p>
  
  <pre><code>&lt;p:menuitem value="#{msg.customerScreen}" url="/restrict/customer.xhtml" /&gt;
  &lt;p:menuitem value="#{msg.productScreen}" url="/restrict/product.xhtml" /&gt;
  </code></pre>
  
  <p>But when I need to redirect to another page, it is redirecting to http instead of https. When using over http, it works perfectly:</p>
  
  <pre><code>&lt;p:commandLink ajax="false" action="/commerce/store.xhtml?faces-redirect=true"&gt;
      &lt;h:graphicImage library="images/BTN" name="btn_to_shop.gif"/&gt;
  &lt;/p:commandLink&gt;
  </code></pre>
  
  <p>As a workaround I tryed to reconstruct the URL:</p>
  
  <pre><code>&lt;p:commandLink ajax="false" action="#{authorizerBean.getCompleteURL('/commerce/store.xhtml?faces-redirect=true')}"&gt;
      &lt;h:graphicImage library="images/BTN" name="btn_to_shop.gif"/&gt;
  &lt;/p:commandLink&gt;
  
  public String getCompleteURL(String page) {
      try {
          FacesContext ctxt = FacesContext.getCurrentInstance();
          ExternalContext ext = ctxt.getExternalContext();
  
          URI uri = new URI(ext.getRequestScheme(), null, ext.getRequestServerName(), ext.getRequestServerPort(), ext.getRequestContextPath(), null, null);
          return uri.toASCIIString() + page;
      } catch (URISyntaxException e) {
          throw new FacesException(e);
      }
  }
  </code></pre>
  
  <p>The method getCompleteURL is being called and returning the URL correclty, but JSF is not redirecting to the new URL.</p>
  
  <p>JBoss is receiving an HTTP connection. Who manages the HTTPS is Apache, that redirects to JBoss:</p>
  
  <pre><code>&lt;VirtualHost *:443&gt;
  
      ...
  
      ProxyPass / http://server:8080/
      ProxyPassReverse / http://server:8080/
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I would prefer to solve this issue without using the getCompleteURL, but if it is not possible, please help me with other approaches.</p>