Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Session mangement: URL rewriting

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

From my browser I disabled the Cookies to check the URL rewriting thing.

In my servlet I use the following code



I deploy and run the application, ensured that the cookies are disabled by getting request.getCookies() as NULL, when I do mouse over on the 'Click Me' I do not see anything like ';jsessionid=123456' appended to the URL. If I click still on the URL bar I am unable to see this thing.

Could anyone help me out to solve the problem.
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have no idea what you are trying to do.. but following works for me.. please compare it with your code

 
Mukesh Bhojwani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Poonam, Thanks for correcting the quote miss match.

I explain you what I am intending to do.

In HFJS I read if cookies are disabled the container uses URL rewriting provided you use encodeURL(..) function, and the URL will automatically be appended with JSESSIONID
E.g
http://192.168.0.127:8084/CookieTest/result.jsp;jsessionid=123456

So with the code below (cosider the one provided by you), the URL is created, now providing URL pattern of the servlet on the browser I get 'Click Me' hyperlink. Now when I do mouse over to 'Click Me' hyperlink, in the status bar of the browser where the url appears, I expect ;jsessionid=123456 appended to the URL but it is not. Moreover, the same thing happens when I click the link, the browser's url bar also resembles the same thing.

I hope, I explained the problem. Please let me know if there require further explanations.
 
Poonam Kohli
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mukesh Bhojwani wrote:Hi Poonam, Thanks for correcting the quote miss match.

I explain you what I am intending to do.

In HFJS I read if cookies are disabled the container uses URL rewriting provided you use encodeURL(..) function, and the URL will automatically be appended with JSESSIONID
E.g
http://192.168.0.127:8084/CookieTest/result.jsp;jsessionid=123456

So with the code below (cosider the one provided by you), the URL is created, now providing URL pattern of the servlet on the browser I get 'Click Me' hyperlink. Now when I do mouse over to 'Click Me' hyperlink, in the status bar of the browser where the url appears, I expect ;jsessionid=123456 appended to the URL but it is not. Moreover, the same thing happens when I click the link, the browser's url bar also resembles the same thing.

I hope, I explained the problem. Please let me know if there require further explanations.



Mukesh,

I completely understand what you are trying to do. But did my solution not work? Did it not append the jsessionid? It works for me..
 
Mukesh Bhojwani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Poonam... it's unfortunate that your solution as well not worked for me. When I hover mouse to 'Click Me', in browser's status bar it's showing only the URL WITHOUT ;jsessionid=123456.

Am I missing anything??? Please guide me.
 
We don't have time to be charming! Quick, read this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic