|
We use the Grails 2.0 resources stuff, as well as the cached-resources plugin.
We have an image that is linked to from within a css. It works fine in development (name gets hashed, etc.), but when I deploy as a war to a test server, the url in the css doesn't get rewritten. So the image doesn't show on the page.
All the other images in the css do get rewritten when deployed as a war. Here's an example in the css that works: div.mainBoxBRC { background: url(2re1hnj8sIDszn1GYgN1EYL3rQXhuXnpOTVkUiX8MWQ.png) 100% 100% no-repeat;
} Here's the one that doesn't work, in the original css: div.errors li { background: url(../images/skin/exclamation.png) 8px 0% no-repeat !important;
line-height: normal !important; padding-left: 30px !important; } Here's what it looks like once the css has been pulled down to the browser: div.errors li { background: url(resource:/images/skin/exclamation.png) 8px 0% no-repeat !important; line-height: normal !important; padding-left: 30px !important;
} Any suggestions?
|
|
On 19 Sep 2012, at 15:08, Alan Bowsher <[hidden email]> wrote: > We use the Grails 2.0 resources stuff, as well as the cached-resources plugin. > > We have an image that is linked to from within a css. It works fine in development (name gets hashed, etc.), but when I deploy as a war to a test server, the url in the css doesn't get rewritten. So the image doesn't show on the page. > > All the other images in the css do get rewritten when deployed as a war. > > Here's an example in the css that works: > > div.mainBoxBRC { > background: url(2re1hnj8sIDszn1GYgN1EYL3rQXhuXnpOTVkUiX8MWQ.png) 100% 100% no-repeat; > } > > Here's the one that doesn't work, in the original css: > > div.errors li { > background: url(../images/skin/exclamation.png) 8px 0% no-repeat !important; > line-height: normal !important; > padding-left: 30px !important; > } > > Here's what it looks like once the css has been pulled down to the browser: > > div.errors li { > background: url(resource:/images/skin/exclamation.png) 8px 0% no-repeat !important; > line-height: normal !important; > padding-left: 30px !important; > } > > Any suggestions? 1) Let us know what version of Resources you are using, and if not 1.2.RC2 try that 2) Are you setting grails.resources.work.dir to a valid folder on your server? 3) How are you deploying - expanded WAR or not. Try expanded if not 4) It looks like it cannot find that file in production, hence it cannot map it from a resource:/ url to the final url. Marc ~ ~ ~ Marc Palmer Freelancer (Grails/Groovy/Java/UX) I offer commercial support for Grails plugins from as low as $50/mo. For details see: http://grailsrocks.com Blog: http://www.anyware.co.uk | Resumé: http://www.anyware.co.uk/marc Contributor @ http://grails.org | Founder @ http://noticelocal.com Developer @ http://weceem.org | Member @ http://spottymushroom.com Twitter: http://twitter.com/wangjammer5 --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
Thanks for the reply Marc.
1) Let us know what version of Resources you are using, and if not 1.2.RC2 try that We are using 1.1.6, b/c I believe that's what Grails 2.1 pulled in. I'll try the newer based on your recommendation.
2) Are you setting grails.resources.work.dir to a valid folder on your server? No, we don't have this variable set. Weird though that other resources would work fine. 3) How are you deploying - expanded WAR or not. Try expanded if not No, I'll have to try that. 4) It looks like it cannot find that file in production, hence it cannot map it from a resource:/ url to the final url. If I plug in the url directly into the browser (.ie. just remove the resource: below and start from the root of our webapp), it finds the image (and forwards to the hashed name). So it is there.
Thanks for the suggestions, I'll play around with this a bit later and reply back. Very strange though that all other png's in the same css work fine.
On Wed, Sep 19, 2012 at 10:27 AM, Marc Palmer <[hidden email]> wrote:
|
|
On 19 Sep 2012, at 16:04, Alan Bowsher <[hidden email]> wrote: > Thanks for the reply Marc. Use 1.2.RC2 and I think the problem will go away. It sounds like the pre-1.2 race condition where request to the ad hoc image resource before full processing of the CSS had completed. Marc ~ ~ ~ Marc Palmer Freelancer (Grails/Groovy/Java/UX) I offer commercial support for Grails plugins from as low as $50/mo. For details see: http://grailsrocks.com Blog: http://www.anyware.co.uk | Resumé: http://www.anyware.co.uk/marc Contributor @ http://grails.org | Founder @ http://noticelocal.com Developer @ http://weceem.org | Member @ http://spottymushroom.com Twitter: http://twitter.com/wangjammer5 --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
| Powered by Nabble | Edit this page |
