Details

    • Type: Sub-task Sub-task
    • Status: Reopened
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Resources
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      884
    • Status Whiteboard:
      Hide

      size_small importance_medium

      Show
      size_small importance_medium

      Description

      Consider a stylesheet

      <h:outputStylesheet library="styles" name="skin.css"/>

      Resources are loaded with URLs such as

      /context path/faces/javax.faces.resource/skin.css?ln=styles

      (when prefix mapping is used).

      CSS files commonly contain url(...) expressions such as

      .ui-icon

      { width: 16px; height: 16px; background-image: url(myicon.png); }

      These url(...) expressions fail to locate the dependent resources.

      This discussion further explains the problem:
      http://forums.sun.com/thread.jspa?threadID=5447194.

      It is not reasonable to ask the users to rewrite the URLs in the style sheet
      since style sheets are often auto-generated.

      While it might be possible for JSF to automatically rewrite the URLs in a style
      sheet as it is loaded, that would not work for other files (e.g. JavaScript).

      If instead the library name is added as a prefix, then the problem goes away:

      /context path/faces/javax.faces.resource/styles/skin.css

      (NB. I believe the ?ln=xxx is a vestige of an earlier time
      when the version and resource prefix were also specified as request
      parameters, see
      http://blogs.sun.com/rlubke/entry/jsf_2_0_new_feature.)

      In the interest of backward compatibility, we can to provide an application
      configuration parameter

      javax.faces.RESOURCE_URL_MAPPING with options prefix and param

      Then
      http://download-llnw.oracle.com/javaee/6/api/javax/faces/application/Resource.html#getRequestPath%28%29
      needs to be changed as follows:

      1. If getLibraryName() returns non-null, discover if the resources are prefix or
        param mapped, by consulting the application configuration parameter
        javax.faces.RESOURCE_URL_MAPPING. If prefix mapped, insert "/" +
        getLibraryName() after ResourceHandler#RESOURCE_IDENTIFIER. If param mapped, ...

        Issue Links

          Activity

          Hide
          Ed Burns added a comment -

          2.2

          Show
          Ed Burns added a comment - 2.2
          Hide
          rogerk added a comment -

          triage

          Show
          rogerk added a comment - triage
          Hide
          ramiromagalhaes added a comment -

          This is duplicated by JAVASERVERFACES_SPEC_PUBLIC-900.

          Show
          ramiromagalhaes added a comment - This is duplicated by JAVASERVERFACES_SPEC_PUBLIC-900 .
          Hide
          lamine_ba added a comment -

          It seems that someone has reported this issue since a long time . It was one of the first issue I have to deal with JSF 2.0. How to load with css an image stored in my images folder?
          If my faces servlet is mapped to .faces, I can overcome this problem by doing this

          background-image: url(myicon.png.faces?ln=images)

          If my faces servlet is mapped to /faces/*, I can overcome this problem by doing this

          background-image: url(myicon.png?ln=images)

          If would be nice if we could come back to this

          background-image: url(images/myicon.png)

          Show
          lamine_ba added a comment - It seems that someone has reported this issue since a long time . It was one of the first issue I have to deal with JSF 2.0. How to load with css an image stored in my images folder? If my faces servlet is mapped to .faces, I can overcome this problem by doing this background-image: url(myicon.png.faces?ln=images) If my faces servlet is mapped to /faces/*, I can overcome this problem by doing this background-image: url(myicon.png?ln=images) If would be nice if we could come back to this background-image: url(images/myicon.png)
          Hide
          Jakob Korherr added a comment -

          The problem described by lamine_ba is exactly why I created the MyFaces commons resourcehandler module (see [1]). Fortunately I already talked with Ed about it, and we will try to address this issue by re-using some of the code/concepts from MyFaces commons resourcehandler!

          [1] https://svn.apache.org/repos/asf/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/

          Show
          Jakob Korherr added a comment - The problem described by lamine_ba is exactly why I created the MyFaces commons resourcehandler module (see [1] ). Fortunately I already talked with Ed about it, and we will try to address this issue by re-using some of the code/concepts from MyFaces commons resourcehandler! [1] https://svn.apache.org/repos/asf/myfaces/commons/branches/jsf_20/myfaces-commons-resourcehandler/
          Hide
          Ed Burns added a comment -

          Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

          Show
          Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

            People

            • Assignee:
              Unassigned
              Reporter:
              cayhorstmann
            • Votes:
              5 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: