• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between urlencoding and urlrewriting

 
yogesh srinivasan
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain me the difference between url-encoding and url-rewriting and how both of this be implemented in servlets?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this thread.
 
Abdul Rahman
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
URL Encoding is a process of transforming user input to a form that is fit for travel across the network. It basically means stripping spaces and punctuation and replacing with escape characters. URL Decoding is the reverse process. To perform these operations, call java.net.URLEncoder.encode() and java.net.URLDecoder.decode().

Example: changing "Payment Done" into "Payment%20Done". The space character has been encoded to %20.

URL Rewriting is a technique for saving state or session information on the user's browser between page hits. Its a session management technique. The session information gets appended at the end of the URL, as an additional parameter. The HttpSession API, which is part of the Servlet API, sometimes uses URL Rewriting when cookies are unavailable. This is achieved through HttpServletResponse encodeURL(String url).

something like: www.someserver.com/paymentPage.jsp/confirm;jsessionid=j765adof765TVSc. The session information is added to the end of the url.

 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Abdul,

Such a nice explanation
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic