I user session to keep some variable in order to be used
in later different page.
when I use relative url to indirect another page, the session
become null.
for ex:
the A.jsp
<%
String userID = "aaa";
session.setAttribute("username", userID);
String myuserID = (String)session.getValue("username");
%>
User ID: <%=myuserID%><br>
UserJenny ID: <%=userID%><br>
<!--a href="testSessionB.jsp">All </a-->
<
jsp:forward page="testSessionB.jsp"/>
the B.jsp
<%
String userID = (String)session.getValue("username");
%>
SessionUser ID: <%=userID%>
in A.jsp when I use
<a href="testSessionB.jsp">All </a>
the SessionUserID is null.
when I use
<jsp:forward page="testSessionB.jsp"/>
the SessionUserID is aaa.
So, what's the differents? and how can I keep my
variable for all the application?
Thanks
Krussi