alexo / wro4j

New project location is:https://github.com/wro4j/wro4j
442 stars 110 forks source link

cssUrlRewriting wrong url with wro4j 1.7.3 #173

Closed chatellier closed 10 years ago

chatellier commented 10 years ago

Hi,

In current wro4j version 1.7.3, cssUrlRewriting rewrite url like this (jquery-ui):

.ui-widget-header .ui-icon {
    background-image: url("/myapp/wro/wroAPI/wroResources?id=classpath:META-INF/resources/nuiton-js-jquery-ui/css/base/images/ui-icons_222222_256x240.png");
}

This link to 404 error. Temporary workarround is to downgrade to version 1.7.0 that generates following correct urls:

.ui-widget-header .ui-icon {
    background-image: url("/myapp/wro/wroResources?id=classpath:META-INF/resources/nuiton-js-jquery-ui/css/base/images/ui-icons_222222_256x240.png");
}
alexo commented 10 years ago

Could you try with latest snapshot version? I think it is fixed in 1.7.4-SNAPSHOT.

chatellier commented 10 years ago

Just tested with 1.7.4-SNAPSHOT, and the problem is not fixed.

Now url looks like:

.ui-widget-header .ui-icon {
    background-image: url(/myapp/wro/myapp.css?wroAPI=wroResources&id=classpath:META-…/resources/nuiton-js-jquery-ui/css/base/images/ui-icons_222222_256x240.png);
}
alexo commented 10 years ago

The problem is not with the way the url looks, but if the rewritten url points to a valid location. Are you still getting 404 with 1.7.4-SNAPSHOT?

chatellier commented 10 years ago

Yes. /myapp/wro/myapp.css is a valid location (css file) but with : /myapp/wro/myapp.css?wroAPI=wroResources&id=classpath:META-…/resources/nuiton-js-jquery-ui/css/base/images/ui-icons_222222_256x240.png, i get a 404 error.

alexo commented 10 years ago

Also, in case the problem can be reproduced... could you provide more details which would simplify the reproduction path (example: content of wro.xml).

chatellier commented 10 years ago

wro.xml file is really huge :), but here here a portion of it for current problem:

<group name='myapp'>
  <group-ref>jquery-ui</group-ref>
  <group-ref>jquery-ui-fr</group-ref>
</group>

And groups are defined in following public files : https://nuiton.org/svn/nuiton-js/nuiton-js-jquery/trunk/src/main/resources/META-INF/nuiton-js/wro-jquery.xml https://nuiton.org/svn/nuiton-js/nuiton-js-jquery-ui/trunk/src/main/resources/META-INF/nuiton-js/wro-jquery-ui.xml

It may be a problem with our wro integration. Do you want a simple demo project ?

alexo commented 10 years ago

A demo project would be great. I will try to reproduce using the details you have provided so far. As a starting point for demo project you could use this: https://github.com/wro4j/wro4j-examples/tree/master/custom-processors

alexo commented 10 years ago

I have created a quick example which proves that this should work: https://github.com/wro4j/wro4j-examples/tree/cssUrlRewritingBug/custom-processors

Feel free to fork it and prove the bug still exist.

chatellier commented 10 years ago

Ok, i just forked it : https://github.com/chatellier/wro4j-examples/tree/master/custom-processors But you're rigth, this bug seams to be fixed in 1.7.4-SNAPSHOT. I need to check our integration.

alexo commented 10 years ago

Closing this issue. Feel free to reopen if you find a test-case which proves the bug.