Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

rewritten URLs

 
P Lu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.myserver.com/myservlet/index.html?jsessionid=1234 --> url rewritten true.
or http://www.myserver.com/myservlet/index.html;jsessionid=1234--> url rewritten true
or both true?
Ping Lu
SCJP 1.4 with 96%
 
Vad Fogel
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This looks like two different ideas struggling to get out.
The first url is closer to URL rewriting, but instead of session id, you should supply parameters for request:
http://myserver/index.jsp?fname=john&lname=smith
Your second example looks like an encoded URL where the session id is supplied by response.encodeURL(String URL) method. It's widely used to maintain session tracking if the browser's cookies are disabled.
 
Bryan Basham
author
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
If you are using the term "URL rewriting" from the servlet specification, then the second URL is properly formatted for URL rewriting as it applies to session management using a J2EE Web container.
The first URL simply sends the jsessionid as a form parameter. This strategy will not work for session management as defined by the servlet spec.
The servlet spec states that URL rewriting (for session mgt) must be done as part of the URL "extra info" (which is often delimited from the URL itself by a semi-colon ';') and not part of a GET request form parameter list (which is always delimited by a question mark '?').
Now, I will grant that the term "URL rewriting" might have other interpretations (a part from session mgt), which --I suspect-- is what Vad has pointed out.
HTH,
Bryan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic