ICEfaces
  1. ICEfaces
  2. ICE-7518

MyFaces 2: our CSS files that have express language bindings for resource URLs fail when running on portlets

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1-Beta2
    • Fix Version/s: 3.0.RC1, 3.0
    • Component/s: Documentation
    • Labels:
      None
    • Environment:
      ICEfaces 3 MyFaces 2 Liferay
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.), Compatibility/Configuration

      Description

      Creating this case as a separate issue based on work done in ICE-7191.

      This is not strictly a portlet issue but it currently only manifests there due to the lengthy nature of Liferay URLS. The problem is seen when running the ACE Showcase Portlets example on Liferay using MyFaces - the problem doesn't manifest with Mojarra. The various 'resource' EL expressions that we use in our themes.css file all look something like this:

      url("#{resource['icefaces.ace:themes/sam/images/ui-default.png']}")

      However, after being processed and sent to the client, they arriving somewhat garbled. Here are a few examples of what the resource URLs get turned into when they arrive at the client - note that the they are incomplete in various spots:

      url("est/acefile?_fileEntry_WAR_showcaseportlet_ln=icefaces.ace&_fileEntry_WAR_showcaseportlet_javax.faces.resource=themes%2Fsam%2Fimages%2Fui-bg_flat_75_ffffff_40x100.png&p_p_col_count=1&p_p_col_id=column-1&p_p_id=fileEntry_WAR_showcaseportlet&p_p_lifecycle=2")

      url("lhost:8080/web/guest/acefile?_fileEntry_WAR_showcaseportlet_ln=icefaces.ace&_fileEntry_WAR_showcaseportlet_javax.faces.resource=themes%2Fsam%2Fimages%2Fui-default.png&p_p_col_count=1&p_p_col_id=column-1&p_p_id=fileEntry_WAR_showcaseportlet&p_p_lifecycle=2")

      url("localhost:8080/web/guest/acefile?_fileEntry_WAR_showcaseportlet_ln=icefaces.ace&_fileEntry_WAR_showcaseportlet_javax.faces.resource=themes%2Fsam%2Fimages%2Fsprite.png&p_p_col_count=1&p_p_col_id=column-1&p_p_id=fileEntry_WAR_showcaseportlet&p_p_lifecycle=2")

      url("b/guest/acefile?_fileEntry_WAR_showcaseportlet_ln=icefaces.ace&_fileEntry_WAR_showcaseportlet_javax.faces.resource=themes%2Fsam%2Fimages%2Fui-icons_222222_256x240.png&p_p_col_count=1&p_p_col_id=column-1&p_p_id=fileEntry_WAR_showcaseportlet&p_p_lifecycle=2")

      Running the ACE Showcase with MyFaces in a non-portlet environment shows the URLs properly resolved:

      url("/my/javax.faces.resource/themes/sam/images/ui-bg_flat_75_ffffff_40x100.png.jsf?ln=icefaces.ace")
      url("/my/javax.faces.resource/themes/sam/images/ui-default.png.jsf?ln=icefaces.ace")
      url("/my/javax.faces.resource/themes/sam/images/sprite.png.jsf?ln=icefaces.ace")

        Issue Links

          Activity

          Repository Revision Date User Message
          ICEsoft Public SVN Repository #26658 Wed Nov 30 16:04:43 MST 2011 deryk.sinotte ICE-7518: add modified myfaces libraries to fix mangling of URLs that are too long
          Files Changed
          Commit graph DEL /icefaces3/trunk/icefaces/lib/myfaces/myfaces-impl-2.1.3.jar
          Commit graph ADD /icefaces3/trunk/icefaces/lib/myfaces/myfaces-api-2.1.3-ice-7518.jar
          Commit graph ADD /icefaces3/trunk/icefaces/lib/myfaces/myfaces-impl-2.1.3-ice-7518.jar
          Commit graph DEL /icefaces3/trunk/icefaces/lib/myfaces/myfaces-api-2.1.3.jar
          Deryk Sinotte created issue -
          Hide
          Deryk Sinotte added a comment -

          Turns out that the issue is related to long URLs that are generated by Liferay and how they are processed by MyFaces in ResourceImpl. There is a special private class in there that's used for processing EL in CSS files:

          private class ValueExpressionFilterInputStream extends InputStream
          {
          private PushbackInputStream delegate;

          public ValueExpressionFilterInputStream(InputStream in)

          { super(); delegate = new PushbackInputStream(in,255); }

          ...

          With Liferay, the resulting URLs can actually be longer than 255 characters, causing the PushbackInputStream to behave oddly and provide mangled resource URLs. I'm logging an issue with MyFaces.

          For the upcoming RC1 release, we'll ship our own modified versions of the MyFaces .jars with a the buffer size increased to handle longer URLs.

          Show
          Deryk Sinotte added a comment - Turns out that the issue is related to long URLs that are generated by Liferay and how they are processed by MyFaces in ResourceImpl. There is a special private class in there that's used for processing EL in CSS files: private class ValueExpressionFilterInputStream extends InputStream { private PushbackInputStream delegate; public ValueExpressionFilterInputStream(InputStream in) { super(); delegate = new PushbackInputStream(in,255); } ... With Liferay, the resulting URLs can actually be longer than 255 characters, causing the PushbackInputStream to behave oddly and provide mangled resource URLs. I'm logging an issue with MyFaces. For the upcoming RC1 release, we'll ship our own modified versions of the MyFaces .jars with a the buffer size increased to handle longer URLs.
          Deryk Sinotte made changes -
          Field Original Value New Value
          Link This issue blocks ICE-7191 [ ICE-7191 ]
          Hide
          Deryk Sinotte added a comment -
          Show
          Deryk Sinotte added a comment - Opened up a MyFaces case: https://issues.apache.org/jira/browse/MYFACES-3414
          Deryk Sinotte made changes -
          Assignee Deryk Sinotte [ deryk.sinotte ]
          Hide
          Deryk Sinotte added a comment -

          I've made a change to a local copy of MyFaces 2.1.3 to make the buffer size larger and I no longer see any mangled URLs in the theme.css file. In our icefaces3/trunk/icefaces/lib/myfaces, I've checked in:

          myfaces-api-2.1.3-ice-7518.jar
          myfaces-impl-2.1.3-ice-7518.jar

          which are custom versions of MyFaces 2.1.3 with this one adjustment added.

          Show
          Deryk Sinotte added a comment - I've made a change to a local copy of MyFaces 2.1.3 to make the buffer size larger and I no longer see any mangled URLs in the theme.css file. In our icefaces3/trunk/icefaces/lib/myfaces, I've checked in: myfaces-api-2.1.3-ice-7518.jar myfaces-impl-2.1.3-ice-7518.jar which are custom versions of MyFaces 2.1.3 with this one adjustment added.
          Hide
          Deryk Sinotte added a comment -

          Resolving as fixed. This may need to be applied to future versions of MyFaces as well until they have it fixed.

          It also affects documentation and configuration as versions of MyFaces without this change will have problems with long CSS URLs that are generated via EL processing.

          Show
          Deryk Sinotte added a comment - Resolving as fixed. This may need to be applied to future versions of MyFaces as well until they have it fixed. It also affects documentation and configuration as versions of MyFaces without this change will have problems with long CSS URLs that are generated via EL processing.
          Deryk Sinotte made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Affects [Documentation (User Guide, Ref. Guide, etc.), Compatibility/Configuration]
          Resolution Fixed [ 1 ]
          Ken Fyten made changes -
          Fix Version/s 3.0 [ 10241 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: