hi,
I am wondering if we can detect whether a client has cookie enabled or not
by using jsp and WebLogic commerce server 3.2 running at the backend.
I have tried to use response.encodeURL("/testing/testing.jsp") to return me
an encoded string. In theory, an application server (supports URL rewriting)
encodes the specific URL by including the session ID in it, or, if encoding
is not needed (i.e. coookie is disabled at client site), returns the URL
unchanged. So
I wrote the following code:
String originalURL="/testing/testing.jsp";
String encodedURL=response.encodeURL(originalURL);
out.println("<br>"+encodedURL);
if (encodedURL.equals(originalURL))
out.println("<br>Sorry, please enable your cookie function");
else
out.println("<br>Enjoy exploring our site");
However, I always get "Enjoy exploring our site" as my WebLogic Commerce
Server always include a session id in the returned URL.
Do I understand encodeURL correctly? Any ideas about cookie detection?
Cheers,
Charles Luo
===========================================================================
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://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets