ICEfaces
  1. ICEfaces
  2. ICE-8902

ExternalContext.isSecure method is not overridden in portlet bridges

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.2, EE-3.2.0.BETA
    • Fix Version/s: EE-3.2.0.GA, 3.3
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      Portlets, ACE GMap Component
    • Assignee Priority:
      P1

      Description

      When running in a portlet, the following exception is thrown when the GMapResourceHandler is run and the isSecure method is called:

      java.lang.UnsupportedOperationException
          at javax.faces.context.ExternalContext.isSecure(ExternalContext.java:1932)

        Activity

        Hide
        Deryk Sinotte added a comment -

        The ExternalContext.isSecure method is called by the GMapResourceHandler to determine whether the http or https protocol should be used to load the Google Maps API library. The problem stems from the fact that the portlet bridges' (both the PortletFaces and LiferayFaces versions) ExternalContext implementations do not override the isSecure method. ExternalContext.isSecure was only added in JSF 2.1 and the bridges are compile against JSF 2.0. I've contacted the LiferayFaces developer and they will be fixing it in a future release but in the meantime, we need to address this ourselves.

        Show
        Deryk Sinotte added a comment - The ExternalContext.isSecure method is called by the GMapResourceHandler to determine whether the http or https protocol should be used to load the Google Maps API library. The problem stems from the fact that the portlet bridges' (both the PortletFaces and LiferayFaces versions) ExternalContext implementations do not override the isSecure method. ExternalContext.isSecure was only added in JSF 2.1 and the bridges are compile against JSF 2.0. I've contacted the LiferayFaces developer and they will be fixing it in a future release but in the meantime, we need to address this ourselves.
        Hide
        Deryk Sinotte added a comment -

        I changed the call so that the GMapResourceHandler now calls EnvUtils.isSecure(). This is a new method that tries to call ExternalContext.isSecure but, if that fails with an UnsupportedOperationException, tries to safely use the HttpServletRequest or PortletRequest via reflection. Resolving as fixed.

        Show
        Deryk Sinotte added a comment - I changed the call so that the GMapResourceHandler now calls EnvUtils.isSecure(). This is a new method that tries to call ExternalContext.isSecure but, if that fails with an UnsupportedOperationException, tries to safely use the HttpServletRequest or PortletRequest via reflection. Resolving as fixed.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: