Hi,
   I think it is because ther are two ways in which strings are handled in
Java. When u give -- session.putValue("somename","0"); it doesn't create a
new String object in heap but in pool of literal strings. But when u
specify --
session.puValue("somename",new String("0")); it creates the object in the
heap as well as in the pool and the object handle points to the object
created in the heap....
 So it might be the case that while using the getvalue() of session
object...it searches in the heap for the required object which won't be
there if u have specified
-- session.putValue("somename","0");

 Hope it's useful,
Niraj

Amar_singh <[EMAIL PROTECTED]> on 10/13/2000 11:20:08 AM

Please respond to A mailing list about Java Server Pages specification and
      reference <[EMAIL PROTECTED]>

To:   [EMAIL PROTECTED]
cc:    (bcc: Niraj Nath/India/IBM)
Subject:  regarding putValue and getValue




hi
I am using session.putValue("somename","0");

initially i am directing the response to a jsp and there i am using
getValue
and it works fine but again when the servlet is invoked then again i do
 session.puValue("somename","0");
and when this is sent  to another JSP then it doesn't work
although if i do
 session.puValue("somename",new String("0")); then it works ...any ideas
why????

Regards
Amar Deep Singh

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
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".
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