| Author |
URL rewriting
|
Manish Shinde
Ranch Hand
Joined: Mar 30, 2011
Posts: 39
|
|
I have some doubts in URL rewriting.
I have made servlet UrlRewrite.java where I m using encodeURL() and then going to
Page Hi.jsp.
When clicked on link, I got Hi.jsp page and jsession id appended to the url.
Then I clicked on link & went to bye.jsp
But this time I go the output as "session is new" .
Question :
1)Is it necessary to use response.encodeURL() everytime when you are navigating form one page to another using <a href=""></a> tags. ?
2)when I use requestDispatcher from Hi.jsp to Bye.jsp.then i got output "session is not new", WHY ?
NOTE : I have disabled browser cookies.
Thanks in advance.
manish
|
 |
Abhay Agarwal
Ranch Hand
Joined: Feb 29, 2008
Posts: 693
|
|
1. Yes
2. because session is not chnaged as you move from Hi.jsp to Bye.jsp
By the way , your Hi.jsp code is wrong. correct code is
<%@page contentType="text/html" session="true" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
|
Oracle certified Java 7 Programmer, SCJA 1.0, SCJP 5.0, SCWCD 5.0, Oracle SQL Fundamentals I
|
 |
Manish Shinde
Ranch Hand
Joined: Mar 30, 2011
Posts: 39
|
|
Thank You
|
 |
 |
|
|
subject: URL rewriting
|
|
|