11 Replies Latest reply on Mar 14, 2007 12:22 AM by tony.herstell1

    Pages.encodeScheme(), HTTPS, and context root '/'

    flashguru

      Hello everybody!

      public String encodeScheme(String viewId, FacesContext context, String url)
       {
       String scheme = getScheme(viewId);
       if (scheme != null)
       {
       String requestUrl = getRequestUrl(context);
       if (requestUrl!=null)
       {
       try
       {
       URL serverUrl = new URL(requestUrl);
       url = scheme + "://" + serverUrl.getHost() + ':' + serverUrl.getPort() + '/' + url;
       }
       catch (MalformedURLException ex)
       {
       throw new RuntimeException(ex);
       }
       }
       }
       return url;

      I have Apache in front of JBoss AS. And my application is mounted as the ROOT context '/'. My http and https ports are 80, 443. The https redirect does not work with such a configuration. And I think it is related to the above code in Seam Pages.java.
      serverUrl.getHost() returns -1. And an extra '/' is always added before the view id, resulting in something like https://www.test.com:-1//index.seam

      This really looks like a bug to me. Any thoughts!