Issue resolving jsSources paths

24 views
Skip to first unread message

florent...@gmail.com

unread,
Apr 5, 2016, 3:05:04 PM4/5/16
to wro4j
Hi,

During js build, wro4j looks for all js files specified in js sources, and process it.
It seems it requests the js files through http or https. Can anyone point me where this is done ?

We have 2 issues:
- we have a redirect (302) from http to https via apache, so wro4j request to js file fails, get a 302, and dont get the file instead of resolving the redirection
- we do the js process (minification, concatenation) at tomcat start (warmup), seems the webapp is not ready yet when wro4j do its warmup, so some js file are missing via http, but are present in the filesystem.

Can wro4j access to resources through filesystem instead of http requests ?

Thanks for any advices.
If anyone know where to hook the path resolution.

Cheers

Alex Objelean

unread,
Apr 6, 2016, 6:23:40 AM4/6/16
to wro4j, florent...@gmail.com

Hi Florent,

the resource retrieval is a responsibility of "UriLocator"'s. There are several implementations which are used based on the resource uri. 
If the uri starts with "http" or "https", the UrlUriLocator is used. 
If the uri starts with "/" the ServletContextUriLocator is used. 

It is very likely, that redirects are not followed while resource are located. This would make sense for both: UrlUriLocator & ServletContextUriLocator. 
Feel free to open an issue.

Regarding your second question, the filesystem resources can be located as well using the UrlUriLocator. All you have to do, is to update the resource uri to something that looks like this: 

<js>file:/var/temp/application.js</js>

More details are documented here.

Let me know if that helps.

Cheers,
Alex
Reply all
Reply to author
Forward
0 new messages