This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use url rewriting in servlets

 
bhaskaritp naidu
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

if cookies disabled , we can use url rewriting to maintain session state.

but i am not understanding urlrewriting thing.

in hfsj book they mentioned this code in doGet method.


out.println("");



what is the BeerTest.do here?

will it make new link in client browser?

if it make new link, what about actual design page of client?

Please clarify my doubts.

Thanks
Bhaskar
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not familiar with that example, but the way to obtain a rewritten URL is to use the HttpServletResponse.encodeURL method.
 
Ankit Garg
Sheriff
Posts: 9497
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in hfsj book they mentioned this code in doGet method.
out.println("");

Which page exactly are you talking about. Please post a little excerpt from the code to show us actually what that code is doing. In a servlet URL rewriting can be done using HttpServletResponse.encodeURL/encodeRedirectURL and in JSPs it can be done using c:url tag...
 
bhaskaritp naidu
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry that example like this

out.println("<a href=\""+response.encodeURL("/BeerTest.do")+"\"click me</a>");
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic