Monday, 15 April 2013

java - passing query parameter to graphicImage to prevent img caching -



java - passing query parameter to graphicImage to prevent img caching -

i need pass query parameter graphicimage prevent ie using old cached image.

i tried below , getting error: file not found: /res_not_found

class="lang-xhtml prettyprint-override"><h:graphicimage library="default" name="img/msm_headersplash.png?v=1.1" alt=" " width="487" height="68" />

below works, don't want hardcode resources path:

class="lang-xhtml prettyprint-override"><h:graphicimage value="resources/default/1_0/img/msm_headersplash.png?v=1.1" alt=" " width="487" height="68" />

you can seek this

easiest add together folder "virtual context" of servletcontainer you're using. it's unclear 1 you're using. in tomcat it's matter of adding new server.xml

<context docbase="/path/to/images" path="/images" />

and in glassfish it's matter of adding alternatedocroot glassfish-web.xml

<property name="alternatedocroot_1" value="from=/images/* dir=/path/to" />

refer documentation of servletcontainer details. should accessible normal url can utilize example:

<p:graphicimage value="/images/msm_headersplash.png?v=1.1" />

java jsf jsf-2

No comments:

Post a Comment