Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3375

MyFaces can incorrectly determine that Portlets are not supported

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.9
    • 2.0.10, 2.1.4
    • JSR-314, Portlet_Support
    • None

    Description

      There are two issues I'd like to report here.

      1) Bridge Class is specific to Apache

      org.apache.myfaces.shared.util.ExternalContextUtils.java / isPortlet(ExternalContext ec) does the following:

      return getRequestType(ec).isPortlet();

      This class. contains the logic to determine if Portlet is supported by finding a Bridge class and can return the incorrect value when a Bridge other than the Apache Bridge is available. For instance in
      WebSphere Application Server (WAS) when running in a Portlet environment the MyFaces code incorrectly returns a Servlet RequestType.

      After looking at the code I see why this is:
      //Summary of values obtained
      javax.portlet.PortletContext = _PORTLET_CONTEXT_CLASS
      javax.portlet.ActionRequest = _PORTLET_ACTION_REQUEST_CLASS
      javax.portlet.RenderRequest = PORTLET_RENDER_REQUEST_CLASS
      javax.portlet.ResourceRequest = _PORTLET_RESOURCE_REQUEST_CLASS

      //Find bridge to tell if portal is supported
      Class<?> bridge = ClassLoaderUtils.loadClass("javax.portlet.faces.Bridge");

      If the above javax.portlet.faces.Bridge Class is not found then PortletSupported variables are set to false. There needs to be a better way to determine if a Bridge is
      available and therefore determine if Portlets are supported in this environment.

      2) Portlet support is determined globally which is not always the case, a more granular determination is needed at the application level.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            paul.nicolucci Paul Nicolucci
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: