image references in plain html pages does not generate unique hashcode

» Back to forum topics
  3 posts   Feedicon  
Replies: 2 - Last Post: August 28, 2012 16:16
by: mhvenkat
showing 1 - 3 of 3
Posted: August 12, 2012 15:26 by mhvenkat

Hi,

I am using regular image tags in plain html and they are served by Jawr Image servlet. I could see the request handled by the servlet. However no unique hashcode is generated and added to the url. It is a plain simple image url request.

The same image tag works fine in a JSP using the <jwr:img src="image url" />.
BTW I have set debug=true in jawr.properties

What is the equivalent of <jwr:img src="image url" /> for plain html pages.

In plain html for scripts and css I use the JAWR.loader. e,g,

JAWR.loader.style('/skins/all-skin.css');
JAWR.loader.script('/bundles/skinSwitcher.js');
JAWR.loader.script('/bundles/all.js');
JAWR.loader.script('/bundles/msg.js');

Appreciate your help.

Thanks
--Mahesh
Posted: August 15, 2012 17:25 by icefox
Hi,

Normally, the hashcode must be added to the generated URL.
There is no equivalent to JAWR.loader for images, but you can use the tag :

<jwr:imagePath src="/img/icons/clock.png" />

This will generate only the URL, which you will be able to affect to a JS variable as a String if needed.

Cheers,
Posted: August 28, 2012 16:16 by mhvenkat
Hi,

Thanks for your response. <jwr> tag cannot be used in a html file.
It looks like you are suggesting that I have a jsp file that references image urls as a <jwr:imagePath> tag, load this JSP file and assign imagepath to JS variables and then use them in a html file ?

This approach is doable, although it is not an elegant solution.
A JAWR loader would be ideal!

I will try this approach.

Is there is similar solution to manage static html files ?

Thanks
--Mahesh
Replies: 2 - Last Post: August 28, 2012 16:16
by: mhvenkat