5 Replies Latest reply on Jul 31, 2012 5:09 AM by periklis_douvitsas

    JsessionId getting appended to image rendered by h:graphicImage




      Am using JSF 1.2


      I have an image which should be clickable. Below is how I have coded,


      <h:commandLink value="" action="#{myBean.myAction}>

            <h:graphicImage value="image-location-in-webserver">



      Am using h:commandLink because on click of this image I have to do some business validations and hence I need to call a method in bean.

      My bean is session scoped. I can't go with request scope because of some other problems.

      I tried javax.faces.STATE_SAVING_METHOD setting it to client instead of server.

      Even then when my page is rendered, image is not getting redered because jsessionid is getting appended to url like below when viewed in web developer.




      If jsessionid is not appended, my image gets rendered.


      I tried URL rewrite in urlrewrite.xml as mentioned below. It didnt work



      I wrote a rewrite rule in Apache web server. Didnt work!


      I have to use h:graphicImage instead of <img src> because I need to call a method in bean. If I use <img> tag, jsessionid is not appended.


      Please help!