This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt 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

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "url rewriting" Watch "url rewriting" New topic

url rewriting

anarkali perera
Ranch Hand

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

Joined: Jul 29, 2008
Posts: 3698

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 ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- 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

Joined: Aug 03, 2008
Posts: 9434

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.

this is encodeURL.jsp

this is EncodeURLProgram.jsp

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

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:
subject: url rewriting
It's not a secret anymore!