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

          No work has yet been logged on this issue.

            People

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

              Dates

              • Created:
                Updated: