Wicket
  1. Wicket
  2. WICKET-4732

CssPackageResource doesn't work if the extension isn't css

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.8
    • Fix Version/s: 6.1.0, 1.5.9
    • Component/s: wicket
    • Labels:
      None

      Description

      CssPackageResource#processResponse is never called if the extension isn't css. It works for .css because PackageResourceReference#getResource checks if the extension is css and then creates a CssPackageResource. For anything else than .css/.js a PackageResource is created.

      Actually the overridden processResponse method in CssPackageResource (instead of PackageResource) should get called, but ResourceReferenceRegistry#createDefaultResourceReference installs a plain PackageResource which gets called later.

      1. wicket-4732.tgz
        21 kB
        Martin Grigorov
      2. wicket-4732.zip
        20 kB
        Christoph Leiter

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        2d 2h 58m 1 Martin Grigorov 29/Aug/12 12:03
        Emond Papegaaij made changes -
        Fix Version/s 6.1.0 [ 12322957 ]
        Fix Version/s 6.0.1 [ 12322956 ]
        Martin Grigorov made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Martin Grigorov [ mgrigorov ]
        Fix Version/s 6.0.1 [ 12322956 ]
        Fix Version/s 1.5.9 [ 12322962 ]
        Resolution Fixed [ 1 ]
        Hide
        Martin Grigorov added a comment -

        Fixed + test.

        Show
        Martin Grigorov added a comment - Fixed + test.
        Hide
        Christoph Leiter added a comment -

        Use this in the Wicket 6 quickstart:

        public class LessPackageResource extends CssPackageResource {
        public LessPackageResource(Class<?> scope, String name)

        { super(scope, name, null, null, null); }

        @Override
        protected byte[] processResponse(Attributes attributes, byte[] bytes)

        { System.err.println("CALLED"); return super.processResponse(attributes, bytes); }

        }

        processResponse is also never called there.

        Show
        Christoph Leiter added a comment - Use this in the Wicket 6 quickstart: public class LessPackageResource extends CssPackageResource { public LessPackageResource(Class<?> scope, String name) { super(scope, name, null, null, null); } @Override protected byte[] processResponse(Attributes attributes, byte[] bytes) { System.err.println("CALLED"); return super.processResponse(attributes, bytes); } } processResponse is also never called there.
        Christoph Leiter made changes -
        Attachment wicket-4732.zip [ 12542903 ]
        Hide
        Christoph Leiter added a comment -

        Attaching quickstart for 1.5.8. The HomePage renders main.css and main.less. The installed ICssCompressor is only called for main.css but should be called for both.

        Show
        Christoph Leiter added a comment - Attaching quickstart for 1.5.8. The HomePage renders main.css and main.less. The installed ICssCompressor is only called for main.css but should be called for both.
        Martin Grigorov made changes -
        Field Original Value New Value
        Attachment wicket-4732.tgz [ 12542902 ]
        Hide
        Martin Grigorov added a comment -

        Here is a quickstart with 6.0 that works.

        Show
        Martin Grigorov added a comment - Here is a quickstart with 6.0 that works.
        Christoph Leiter created issue -

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Christoph Leiter
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development