Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About URL Rewriting

 
Sony Agrawal
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is urlRewriting done?
I tried it, i had to do the following statements..
1. res.encodeURL("encodedURL.jsp");
2.res.sendRedirect("encodedURL.jsp");

So i am assuming that in one statement i have to call the encodeURL method and from then on if i used the senRedirect() the encoded URL will be used(given that cookies are
disabled).

Correct me if i am wrong
 
Minhaj Mehmood
Ranch Hand
Posts: 400
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try something like

 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the API, you'll find out that this method returns a String with the encoded URL, or the String as it came in if session tracking is enabled.
 
Sony Agrawal
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually i wrote it in two different statement.

one that just encodes and the other just redirects......
It would not have confused me if it was like


 
gandhi nagaraj
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can use like this response.encodeRedirectURL("encodedURL.jsp");

Many Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic