Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-2648

Add static methods BridgeUtil.getPortletRequestPhase(FacesContext) and BridgeUtil.isPortletRequest(FacesContext)

    Details

      Description

      The javax.portlet.faces.BridgeUtil class currently has the following methods:

      public static Bridge.PortletPhase getPortletRequestPhase() {
      	FacesContext facesContext = FacesContext.getCurrentInstance();
      	ExternalContext externalContext = facesContext.getExternalContext();
      	Map<String, Object> requestMap = externalContext.getRequestMap();
      
      	return (Bridge.PortletPhase) requestMap.get(Bridge.PORTLET_LIFECYCLE_PHASE);
      }
      
      public static boolean isPortletRequest() {
      	FacesContext facesContext = FacesContext.getCurrentInstance();
      	ExternalContext externalContext = facesContext.getExternalContext();
      	Map<String, Object> requestMap = externalContext.getRequestMap();
      	Bridge.PortletPhase portletPhase = (Bridge.PortletPhase) requestMap.get(Bridge.PORTLET_LIFECYCLE_PHASE);
      
      	return (portletPhase != null);
      }
      

      This issue serves as a proposal for adding two more methods, which take FacesContext as a parameter:

      public static Bridge.PortletPhase getPortletRequestPhase(FacesContext facesContext) {
          ...
      }
      public static boolean isPortletRequest(FacesContext facesContext) {
          ...
      }
      

      This will provide bridge implementations to pass the FacesContext ThreadLocal singleton instance if it has already been acquired by calling FacesContext.getCurrentInstance().

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: