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


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

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,'/skins/all-skin.css');

Appreciate your help.

Posted: August 15, 2012 17:25 by icefox

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.

Posted: August 28, 2012 16:16 by mhvenkat

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 ?

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