title: Why does request.getRequestURL() return non-https url?
body: <p>In one of our projects we still have to use JSF 1.2 + Tomcat 6 and the problem is when I'm sending <code>https</code>-request to the server and trying to get requested URL in the managed bean as follows:</p>
  
  <pre><code>ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
  HttpServletRequest request = (HttpServletRequest)context.getRequest();
  String url = request.getRequestURL().toString()
  </code></pre>
  
  <p>The button that sends the request is just a submit-button looked as follows:</p>
  
  <pre><code>&lt;h:form id="contactform"&gt;
      &lt;h:commandButton id="submit" action="#{forgotPasswordBean.doSend}"
   &lt;/h:form&gt;
  </code></pre>
  
  <p>I get <code>http</code>-based URL intead of <code>https</code>.
  In the web-browser's debug panel I made sure that an <code>https</code>-request was actually sent, but URL contained a link to just <code>http</code> request. What's a problem or it's just a bug?</p>