5

Am using JSF 1.2

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

<h:commandLink value="" action="#{myBean.myMethod}>
   <h:graphicImage value="image-location-in-webserver" />
</h:commandLink>

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.

http:/myDomail/static-files/images/myImage.jpg;jsessionid=77F2A5D24CF1D5C3C4882778BC521263.node1

If jsessionid is not appended, my image gets rendered.

How can I achieve this?

jonsca
  • 10,218
  • 26
  • 54
  • 62
Vikas V
  • 3,176
  • 2
  • 37
  • 60
  • Hi, I tried URL rewrite in urlrewrite.xml as mentioned below (http://javatechworld.blogspot.in/2011/01/how-to-remove-jsessionid-from-url-java.html) It didnt work and its affecting other places. I wrote a rewrite rule in Apache web server. Didnt help ! – Vikas V Jul 27 '12 at 08:30
  • 2
    Please see the solution at http://stackoverflow.com/questions/11349064/jsessionid-how-to-avoid-jsessionid-xxx-on-the-first-call-to-a-page-it-works – Reddymails Oct 31 '13 at 19:29

0 Answers0