how to use session tracking

i am making shopping mall project .

ist page conatins list of product avaiale

2nd page contains list of manufacturuer avaible

problem:-

i want to display on 3rd page the product seleted by user in 1st page

i used session tracking concept.but problem is the value is coming null in third page

please tell me how to solve my problem

[376 byte] By [saswat1579a] at [2007-11-27 11:01:47]
# 1

Tried with cookies? or used session ids? have you used any set session attributes?

How did you try to maintain session?

passion_for_javaa at 2007-7-29 12:39:05 > top of Java-index,Java Essentials,Java Programming...
# 2

i am doing in jsp page

like this in first page

session.setAttribute("theName", selection )

an d in third page i am calling using

sesion .getattribute("the name")

i dont know wheter it is enough to do .

else

tell me the way

saswat1579a at 2007-7-29 12:39:05 > top of Java-index,Java Essentials,Java Programming...
# 3

If it is like a shopping cart, I suggest you to look for a good shopping cart examples available plenty online.

But if its just about keeping session variables and using them the following works.

Test with a simple example. Have three jsp files like a.jsp, b.jsp and c.jsp.

put the following in a.jsp

<% session.setAttribute("Mobile","Nokia");%>

<%=session.getAttribute("Mobile")%>

<a href="b.jsp">Go to B.jsp</a>

Print the value of session variable - <%=session.getAttribute("Mobile")%> in b.jsp and c.jsp

And in b.jsp have a link to c.jsp and so on. Once you set a session variable, it lives as long as your session doesnt expire.

Try it. and also look for more session tracking examples online.

Message was edited by:

passion_for_java

passion_for_javaa at 2007-7-29 12:39:05 > top of Java-index,Java Essentials,Java Programming...
# 4

thanku now i understood

whats the problem was

bye

saswat1579a at 2007-7-29 12:39:05 > top of Java-index,Java Essentials,Java Programming...