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

        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.
        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.
        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.
        Hide
        Martin Grigorov added a comment -

        Fixed + test.

        Show
        Martin Grigorov added a comment - Fixed + test.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development