after response.sendRedirect put return statement..
e.g
response.sendRedirect("some page");
return;

also try priting values before putting into and getting from the session...

Nishit

-----Original Message-----
From: iZone Infotech [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 22, 2001 7:17 AM
To: [EMAIL PROTECTED]
Subject: Session


Hi,

I am surprised to see that nobody is responding to my email.  What is the
reason?  Nobody uses Netscape any more!!

I have another problem, again with sessions.

I am putting a value to the session in a servlet and calling a JSP file
using sendRedirect.  My session is empty in the JSP.

The code I am using in servlet is:
(request.getSession(true)).putValue("name","some name");
response.sendRedirect(response.encodeRedirectUrl("http://....../second.jsp")
);

The code in JSP: (This is supposed to get all the elements in the session,
print the total number and the value I have put from the servlet.  This does
not print anything?).
String[] sessionNames = session.getValueNames();
out.println("No of elements :"+sessionNames.length);
out.println(session.getValue("name"));

Can somebody let me know what is happening.  It could a simple stupid error
from my side.

My Netscape problem remains as given below.

> Hi friends,
>
> It seems that 'session' has some problem with Netscape.  I have Tomcat
> installed on my machine.  There is an example of Shopping Cart using
> Sessions in Tomcat. It works fine in IE, but in Netscape, it replaces the
> earlier entry (there us only 1 item in the cart).
>
> I had faced some other problem in sessions with Netscape (same thing
worked
> with IE), so I went hunting for a solution and found out that even the
> TomCat example is giving problem with Netscape.
>
> Did anybody else face similar problems?  If yes what was the solution.
>
> My Webserver supports jsk1.2.1 and jsdk2.0 only.
>
> Regards,
>
> Dantus

===========================================================================
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

===========================================================================
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

Reply via email to