Skip to main content

Optional path prefix for generated URLs

  5 posts   Feedicon  
Replies: 4 - Last Post: January 24, 2014 01:43
by: hweic
showing 1 - 5 of 5
Posted: January 21, 2014 23:04 by hweic
The generated resource URLs currently look somewhat like this:

/<app ctx>/gzip_xxxxxxxxxx/path_to_bundle

In our app, we have a mixture of secure and insecure resources.

Is there a way optionally include a path prefix at a bundle level such that the prefix may be used to specify security exclusion?

For example, appending /pub to the generated path of insecure bundles:

/<app ctx>/pub/gzip_xxxxxxxxxx/path_to_bundle

The above in theory will allow Jawr to serve both secure and insecure resources.

There used to be a bundle level configuration which got deprecated in preference of the generated hashcode:


If something like that could be used in addition to and before the generated hashcode, that would probably work.

If the above functionality isn't supported now, could it be considered as an enhancement?

Thanks in advance for your help!


Posted: January 22, 2014 09:43 by icefox

This could be considered as an enhancement to Jawr.
Please fill a JIRA for this.

Posted: January 22, 2014 23:56 by hweic
Thanks icefox! Created Jira JAWR-263 for this.
Posted: January 23, 2014 09:37 by icefox

Another way to handle this case, would be to have 2 JawrServlet instances.

One for secured bundle the other for none secure one.

The first would be mapped to /pub/* the other one to /secured/*.

Could you try this and see if this fit your need?

I have to say that I'm not sure if this works. They could be impacts from the use of 2 servlets instance of the same type in Jawr.

Posted: January 24, 2014 01:43 by hweic

Yes, we had the same though... we use Spring so configured separate
instances (instead of the servlet). One for secure and the other for public.

What we found was that the latter (last instantiated) instance would trump the first one, causing only one set of bundles to be recognised, ie, the jawr tags don't even generate the script / link html code.

Have tried switching the order around and the reserve set of bundles are served.

Not sure why it doesn't work, but seems like there's some global/singleton structure/cache shared by the instances.

That's when we decided to check in this forum.

Let me know if you think we did something wrong or there's something else we can try.

Replies: 4 - Last Post: January 24, 2014 01:43
by: hweic
Please Confirm