• Type: New Feature New Feature
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: Resources
    • Labels:
    • Status Whiteboard:

      size_small importance_medium

      size_small importance_medium


      The features of this ResourceHandler include the following:

      • relative paths between resources (css files referencing images
        without using #resource['..'])
      • caching resources in the client (disabled if ProjectStage == Development)
      • GZIP compression and local cache in tmp dir (disabled if
        ProjectStage == Development)
      • i18n (supporting country code and language).

      In addition, it does NOT support ValueExpressions in resource files
      for performance reasons.

      The most important feature, in my opinion, is how the resource URL is
      built, e.g. /faces/javax.faces.resource/de_AT/$/some/library/$/my/resource.css

      ... because it permits resources referencing other resources without


      (e.g. css files referencing images or other css
      files). With the standard ResourceHandler this is 1) annoying if you
      have to change the files you get from your designer and 2) a
      performance bottleneck, because resources with ValueExpressions are
      not cached and also regenerated for each request.

      Furthermore, the resource URL contains the locale and thus you have no
      problems with cached resources if a users changes the locale, because
      he/she will get a new URL and thus a new resource (the right one).

        Issue Links


          Ed Burns created issue -
          Jakob Korherr made changes -
          Field Original Value New Value
          Link This issue is duplicated by JAVASERVERFACES_SPEC_PUBLIC-884 [ JAVASERVERFACES_SPEC_PUBLIC-884 ]
          Jakob Korherr made changes -
          Ed Burns made changes -
          Original Estimate 5 days [ 432000 ]
          Remaining Estimate 5 days [ 432000 ]
          Ed Burns made changes -
          Affects Version/s 2.2 [ 10403 ]
          Ed Burns made changes -
          Attachment [ 49420 ]
          Ed Burns made changes -
          Jakob Korherr made changes -
          Attachment [ 49428 ]
          Ed Burns made changes -
          Link This issue is duplicated by JAVASERVERFACES-1189 [ JAVASERVERFACES-1189 ]
          Ed Burns made changes -
          Fix Version/s 2.2 [ 10403 ]
          Ed Burns made changes -
          Fix Version/s 2.3 [ 16372 ]
          Fix Version/s 2.2 [ 10403 ]
          Ed Burns made changes -
          Assignee Ed Burns [ edburns ]
          Ed Burns made changes -
          Priority Minor [ 4 ] Trivial [ 5 ]
          Fix Version/s 2.3 [ 16372 ]
          Manfred Riem made changes -
          Priority Trivial [ 5 ] Critical [ 2 ]
          lamine_ba made changes -
          Comment [ For what it's worth, JSF 2.0 has already a support for Relative Resources but only if you use a prefix mapping in your application. There is a bug in the implementations and it is in how they are interpreting the information in order to create the resource. you can solve this problem by wrapping the default ResourceHandler to correct the mistake in the createResource method. If I put this into practice and reuse the sample war, I will first correct the example by respecting the structure of a resource library. So Here is how things should be laid on.


          * resources
          ** css
          *** style.css
          *** included.css
          ** images
          *** header.png
          *** expert-draft-bg.png

          Now Let's use the style in our Facelets Page

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

          The generated URL will be : http://localhost:8080/faces/javax.faces.resource/style.css?ln=css.

          and the browser will after use http://localhost:8080/faces/javax.faces.resource/ to load the other resources referenced in this css file. So to have them correctly loaded here is how you should reference them

          -style.css : First Version
          @import url(included.css?ln=css);
          -style.css : Second Version

          @import url(css/included.css);

          In this last variation, the one I currently use in my application, The ResourceHandler must be intelligent enough to know that the libraryName will be null and that its value will be inside the resource name ( images/expert-draft-bg.png, css/included.css).


            • Assignee:
              Ed Burns
            • Votes:
              24 Vote for this issue
              7 Start watching this issue


              • Created:

                Time Tracking

                Original Estimate - 5 days Original Estimate - 5 days
                Time Spent - 2 hours Remaining Estimate - 5 days
                Time Spent - 2 hours Remaining Estimate - 5 days