Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to remove jsessionid from a URL

 
Hema Turupu
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have used tuckey urlrewrite for my web application which is working fine on my local system but when I upload files into the server I get a jsessionid appended to my url and it is displaying as page not found.

Once I manually remove the jsessionid from the address bar it is then displaying my webpages. This is happening only for the first time when I enter the URL in a browser. How do I remove the jsessionid that is getting appended to my url.


I have gone through links : http://stackoverflow.com/questions/5276634/remove-jsessionid-in-url-rewrite-in-spring-mvc
http://javatechworld.blogspot.com/2011/01/how-to-remove-jsessionid-from-url-java.html

But still unable to solve this problem.

Can anyone please suggest ASAP?

Regards
Hema
 
Miku Ranjan
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think that is default still if you want to replay please check with javascript on load windlow.location
 
Saifuddin Merchant
Ranch Hand
Posts: 607
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is happening only for the first time when I enter the URL in a browser.


That's because cookies are enabled for the browsers & it (app-server, is it tomcat?) uses cookies when it is sure that cookies are enabled (it can only know cookies are enabled for certain, if it put the jsessionid in the URL for the first request). The jsessionid only goes in if you enable URLRewriting in the code (happens automatically in most frameworks)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic