Uploaded image for project: 'Portals Bridges (Retired)'
  1. Portals Bridges (Retired)
  2. PB-54

PortletViewHandlerImpl.getResourceURL() always prepends the context path.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0
    • 1.0.1
    • jsf
    • None
    • Sun JSF Reference Implementation version 1.2 (jsf-impl.jar)
      Websphere portlet container version 6.1.0
      Apache MyFaces JSF portal bridge version 1.0 (portals-bridges-jsf-1.0.jar)

    Description

      When running an application on the MyFaces JSF portal bridge, I noticed the context path is always appended to the URI path in PortletViewHandlerImpl.getResourceURL() even if the path parameter already contains the context path.

      My JSF portal application loads image resources and css files and when using the Sun portal bridge all the resources resolved. When attempt to use the MyFaces JSF portal bridge, the application failed to find the resources citing a java.io.FileNotFoundException for the resources. The resources that already contained the context path are prepened with another context path. The getResourceURL() method of PortletViewHandlerImpl ALWAYS prepends the context path to the path parameter without checking if it is already there.

      I believe changing the getResourceURL() code to delegate this call to the handler.getResourceURL() method of (javax.faces.application.ViewHandler) would resolve the problem. I made this small change in my sandbox. The URLs with the context path did not get prepended and the application found all resources.

      Is there a reason the PortletViewHandlerImpl does not delegate the getResourceURL() method that I am missing? If there is not a compelling reason not to delegate the call to the included ViewHandler, then perhaps we should delegate the call to javax.faces.application.ViewHandler. If there is a compelling reason perhaps we should add a check if the context path already exists in the path parameter.

      Attachments

        Activity

          People

            taylor David Sean Taylor
            mbruzek Matthew Bruzek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: