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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "url rewriting" Watch "url rewriting" New topic
Author

url rewriting

anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
what is url rewriting in jsp and servlet?
Devaka Cooray
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2691
    
    3

URL rewriting is useful in retrieving the last user session, when cookies are disabled in the client side. Have a look at this article.


Author of ExamLab (Download) - the free mock exam kit for SCJP / OCPJP
Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
what are the other ways of session tracking in jsp?
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2

Generally cookies and url rewriting are used for session tracking. Read a tutorial like this to see an example...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
anarkali perera
Ranch Hand

Joined: Sep 10, 2009
Posts: 237
i found this example from site.http://www.roseindia.net/jsp/jspsession/SessionUsingUrlRewriting.shtml

this is encodeURL.jsp


this is EncodeURLProgram.jsp



this is NextPageAfterFirst.jsp
[code]
<html>
<head>
<title>Welcome in In the program of URL rewriting</title>
</head>
<body>
<font size = 6>Hello</font> <%= session.getAttribute("username") %>
</body>
</html>
[code]

my question is is i enter Williams as a name and abcde as password it gives second page.then i click the link it shows the name which i entered.

my problem is if i remove this part "EncodeURLProgram.jsp" from EncodeURLProgram.jsp also it is working .
then what is the url rewriting?
why we add "?name=+name+&password=+password" this part?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: url rewriting
 
Similar Threads
JSP/form/servlet - session persistence ?
URL same
redirecting the request to URL
URL rewriting ?
Know technique for dynamic URL change