Heyo,
First of all, I'm very happy with wro4j and want to say thanks to any/all open source contributors. I think it is fantastic. I've spent the last couple of days playing around on a demo system and am now nearing the end of completely converting one of our larger apps. The results have been dramatic (like dropping 70+% of download size on some screens).
The last (I hope) hurdle I've run into is getting the CSS URL rewrite feature to play nicely with Bootstrap 2.3.2 from a webjar. I got this working (with help from Alex... thanks) using CSS, but in our main application the LESS imports are used. It appears that because Bootstrap has the URLs stored in LESS variables (eg. @iconSpritePath) that the CSS URL rewriter does not notice them, and then attempts to retrieve them fail with security exceptions.
For example, using CSS, the images are successfully rewritten to:
/static/article.css?wroAPI=wroResources&id=classpath:/META-INF/resources/webjars/bootstrap/2.3.2/img/glyphicons-halflings.png
But using LESS we get:
/static/article.css?wroAPI=wroResources&id=classpath:/META-INF/resources/webjars/bootstrap/2.3.2/less/../img/glyphicons-halflings.png
I think that the problem is the URL rewriter is generating converting this:
background-image: url("@{iconSpritePath}");
to this:
background-image: url("/static/article.css?wroAPI=wroResources&id=classpath:/META-INF/resources/webjars/bootstrap/2.3.2/less/@{iconSpritePath}");
and then the LESS compiler drops "../img/glyphicons-halflings.png" on the end.
At face value this is a good URL, but there is an authorisation exception retrieve because (just guessing here) that the URL rewriter did not see the whole URL when it parsed the import originally. This was my assumption because I tried manually loading the 'good' url:
/static/article.css?wroAPI=wroResources&id=classpath:/META-INF/resources/webjars/bootstrap/2.3.2/img/glyphicons-halflings.png
and it also gets an error, despite having a a correct URL.
Has anyone got this setup working? Is it just a matter of arranging pre/post processors in a particular way? The setup I've got now is:
managerFactoryClassName=ro.isdc.wro.extensions.manager.ExtensionsConfigurableWroManagerFactory
preProcessors=cssUrlRewriting,lessCssImport,semicolonAppender
postProcessors=less4j,jsMin
Haven't gone near css minification yet. I just removed it from the picture whilst testing. I've also tried 'lessCss' just to confirm they make no difference.
Any tips would be appreciated.
Ta,
Greg