File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 12759
    
    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: 18541
    
    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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Url rewriting
 
Similar Threads
servlet initializatoin parameter to get relative path and file name
Session management - cookies / URL rewriting
Problem using JSTL c:redirect.
Error compiling a simple servlet !!.... any ideas??
Streaming Video Through a Servlet (.wmp)