This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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: 12999
    
    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
Sheriff

Joined: Oct 14, 2005
Posts: 19719
    
  10

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?
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Url rewriting
 
It's not a secret anymore!