Hi Catharine,
In order to use URL rewriting, you also need to add the following
code(response.encodeURL("")) into your jsp pages for anything that refers to
urls e.g. hyperlinks or form action values you may have on your page...
For example:
A hyperlink in your jsp page like this,
<a href="myFolder/page1.jsp"> Click Here </a>
would need to me modified to look like this.
<a href="<%= response.encodeURL("myFolder/page1.jsp") %>"> Click
Here </a>
And if you view the source code from the browser window after loading the
page, you will notice that the session id is automatically embedded into the
url as shown below..
<a href="myFolder/page1.jsp;jsessionid=ndq61spjn1"> Click Here </a>
To test it out, I didn't change any settings in the server.xml file.
Instead, I just turned off the accept cookies option in the browser window.
You should be able to find this function in almost all web browsers. and it
is much easier than modifying the server.xml file. Let me know if you
encounter any problems.
Cheers'
Henry Hooi Tak Keong
Software Engineer,
NCS-I (Malaysia) Sdn. Bhd.
Tel : 603-7725-6878;
[EMAIL PROTECTED]
"This email (including all attachments) contains confidential information
which may be privileged. It is intended solely for the identified
recipient(s) to whom it is addressed. If you are not an intended recipient,
please reply to us immediately and delete this message from your system. You
may not copy or use it for any purpose, or otherwise disclose its contents
to any person."
-----Original Message-----
From: cbarnes [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 03, 2001 4:36 PM
To: [EMAIL PROTECTED]
Subject: Re: Session management
I know that a couple of followups to this posting contained viruses, but the
original message was genuine.
Can anyone help me out with this one?
Thanks,
Catharine
----- Original Message -----
From: "cbarnes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 29, 2001 2:55 PM
Subject: Session management
> I am using the default session management in JSPs, but I want it to use
URL
> rewriting instead of cookies. In tomcat/conf/server.xml I changed the
> SessionInterceptor so that noCookies was set to true (it is false by
> default). I thought this would force it to use URL rewriting instead of
> cookies, but when I run my JSPs the URLs are not changed and I am getting
a
> new session each time I load a JSP. Can any one tell me what I should do
in
> order to use URL rewriting.
>
> Thanks,
> Catharine
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://archives.java.sun.com/jsp-interest.html
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.jsp
> http://www.jguru.com/faq/index.jsp
> http://www.jspinsider.com
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com