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

Bridge incorrectly identifies JSF2 relative resource URLs as external URLs

    Details

      Description

      Class com.liferay.faces.bridge.context.url.BridgeResourceURLImpl can not correct encode javax.faces.resource=jsf.js script inserted to <h:head/> section by JSF implementation. It causes portlet container exception.

      Resource url for Websphere Portal is relative to current portal page and it looks like pw/Z7_MP8E1O42IOJ5C0IN44PTV91084/res/c=cacheLevelPage/p=ln=javax.faces/p=javax.faces.resource=jsf.js/p=stage=Development/=/

      Class BridgeResourceURLImpl tries to determine how to encode this URL and processes it as "external URL". This takes place because BridgeResourceURLImpl checks the URL for "external resource" before checking for faces resource.

      So I guess it would be good idea to add "faces resource" checking first.

      Here is pice of original code for method
      BridgeResourceURLImpl#toBaseURL()

      ...

      // Otherwise, if the URL is external, then return an encoded BaseURL string representation of the URL.
      else if (isExternal())

      { // TCK TestPage130: encodeResourceURLForeignExternalURLBackLinkTest baseURL = new BaseURLEncodedExternalStringImpl(url, getParameterMap(), bridgeContext); }

      // Otherwise, if the URL is identified by the ResourceHandler as a JSF2 resource URL, then
      else if (isFaces2ResourceURL()) {

      // If the URL has already been encoded, then return the URL string unmodified.
      if (isEncodedFaces2ResourceURL())

      { // FACES-63: Prevent double-encoding of resource URLs baseURL = new BaseURLNonEncodedStringImpl(url, getParameterMap()); }

      // Otherwise, return a ResourceURL that can retrieve the JSF2 resource.
      else

      { baseURL = portletContainer.createResourceURL(url); }

      }

      ...

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                liferay-faces-2.1.4-ga5
                liferay-faces-2.2.4-ga5
                liferay-faces-3.0.4-legacy-ga5
                liferay-faces-3.0.4-ga5
                liferay-faces-3.1.4-ga5
                liferay-faces-3.2.4-ga5