• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Prevent appending the jsessionid

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,
Inside a <h:dataTable> (running GlassFish v2) I have this code:

showUserInfo - is a JavaScript function which opens a new window, but JSF renders the code by appending a jsessionid which results into a JavaScript error on the client-side when the user clicks the link, because it is rendered like this:

The jsessionid is appended when the user first visits the page, or when he restarts the browser and comes back to this page.
I tried replacing h:outpuLink by <a href> but since the code is inside an h:dataTable the JSF throws an error about bad code.
Any hints on how else to try to solve this issue?
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Too bad this questions is several years old because I think I know the solution. Here is the solution anyways:

Use the onclick attribute instead of the value attribute. You'll want to prevent the default action so make sure to end with a return false. It would look something like:



With this solution the jsessionid isn't prevented, but doesn't affect the JavaScript.
 
passwords must contain 14 characters, a number, punctuation, a small bird, a bit of cheese and a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic