wood burning stoves 2.0*
The moose likes Servlets and the fly likes Url rewriting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Url rewriting " Watch "Url rewriting " New topic
Author

Url rewriting

Pawan Arora
Ranch Hand

Joined: Sep 14, 2008
Posts: 105
Hi,

I'm trying to encode URL to make Url rewriting possible. I've already disable cookies, but when I try to call servlet in subsequent request, I'm getting "New user" as a respone every time.

Here's the servlet code:



The Url pattern, which I've written for servlet name is /Momma.do in DD.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12792
    
    5
Where is that encoded URL supposed to be used?

The browser has to create a request using the encoded URL somehow.

Bill
Pawan Arora
Ranch Hand

Joined: Sep 14, 2008
Posts: 105
Do you mean I'm not creating next request with the same URL which has just encoded. So what's response.encodeURL("/Momma.do") is doing here?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It's encoding the URL and returning a String that you ignore.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

I'm not sure why you would need to worry about cookies or other forms of session preservation when you are forwarding a request. Can you explain why you think you do?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Url rewriting