Hi,

We have 1html file(Index.html) and two JSP files( JSP1.jsp and JSP2.jsp )

>From Index.html we are calling JSP1.jsp.
>From JSP1.jsp we are calling JSP2.jsp.

In JSP1.jsp we are creating a Session object and placing a value in to the Session 
object.
In JSP2.jsp we use the SAME Session object of JSP1.jsp and printing the value.
We are not getting the output as expected.

OUTPUT
======
We are SUPPOSE to get 10 as output in both JSP1.jsp and JSP2.jsp

But, we are getting 10 in JSP1.jsp and NULL in JSP2.jsp
If we navigate back to INDEX.HTML and move to JSP1.jsp and JSP2.jsp then we get 10 in 
JSP1.jsp and 10 in JSP2.jsp.
This is the correct result.

If will be great if you can help us to solve this problem.

Anyway i am attaching snapshot of the code below.

Thanks in advance... R. Bala



CODE  DETAILS
============
Index1.html
-----------------
<a href="http://3.209.128.129:80/NASApp/Jsp_Jsp/jsp1.jsp">Click here</a>

JSP1.jsp
-------------
<%
        Integer numb = new Integer(10);
        out.println("Before putting into session: " + numb);
        HttpSession session = request.getSession(true);

        session.putValue("numb", numb);

        out.println("After putting into session: " + session.getValue("numb"));
        out.println("Session id in jsp1 " + session.getId());
%>
<br>
<a href ="http://3.209.128.129:80/NASApp/Jsp_Jsp/jsp2.jsp">JSP2</a>

JSP2.jsp
-------------
<%
        HttpSession session = request.getSession();
        out.println("Inside JSP2 " + session.getValue("numb"));
                out.println("Session id in jsp2 " + session.getId());

%>

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