• 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

When to use URLRewriting ?

 
Ranch Hand
Posts: 580
Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As i understand Url Rewriting is used when the cookies are disabled by the client. But if the client accepts cookies then url Rewriting is useless(waste of time in writing the code related to urlrewriting stuff).

So does that mean that we use urlrewriting ONLY TO BE at safer side. ?
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Containers only do URL Rewriting if the client doesn't accept cookies. So for the first requests all the links will be rewritten (as the container doesn't know if client accepts cookies), and if the client accepts cookies, then URL Rewriting will be skipped from the second request...
 
James Tharakan
Ranch Hand
Posts: 580
Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankit Garg wrote: then URL Rewriting will be skipped from the second request...


But still when writing the code, the URL rewriting should be done everywhere irrespective of whether the client accepts cookies or not . Isn't it ?
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes
you should ALWAYS use <c:url>, <c:redirect>, response.encodeURL, response.encodeRedirectURL.
And the container should take care about determining if you have cookies enabled (and encoding is not needed), or you have cookies disabled and it needs to keep encoding urls
 
Yeah. What he said. Totally. Wait. What? Sorry, I was looking at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic