M
Michael
Hej Alle!
I'm trying to get this very simple jsp page to work under Tomcat 4.1.x (x=24
and 27, with similar results):
--------------------------
<HTML>
<HEAD>
<TITLE>sessiontest.jsp</TITLE>
</HEAD>
<BODY>
Current value of A is: <%= session.getAttribute("A") %><br>
Now we set the value of A to "george"..<%
session.setAttribute("A","george"); %>..done!<BR>
<BR>
Just to verify, here's A again: <%= session.getAttribute("A") %><BR>
<BR>Now <A href="sessiontest.jsp">reload</A> the page.
</BODY>
</HTML>
--------------------------
When I load the page, everything works as expected. A begins with a null
value, is then set to "george" and this is verified in the last line of
output.
But when I click the link to reload the page, A once again starts as null.
In other words, a new session is created each time the jsp page is loaded.
I have run this exact page under WebSphere 5, and it appeasrs to work as
intended - i.e. the second time the page is loaded, A is already initialized
with "george".
Can anyone tell me what is going on here? What am I doing wrong?
(Please do not ask me to use jsp:useBean - the above is a simplified example
of what I really want to do, which involves setting session attributes from
inside custom tags etc. I really need to set the values using the session
object).
My IE cookie settings are normal, and I'm not using a proxy server.
Mvh
/Michael
www.hyperpal.com
I'm trying to get this very simple jsp page to work under Tomcat 4.1.x (x=24
and 27, with similar results):
--------------------------
<HTML>
<HEAD>
<TITLE>sessiontest.jsp</TITLE>
</HEAD>
<BODY>
Current value of A is: <%= session.getAttribute("A") %><br>
Now we set the value of A to "george"..<%
session.setAttribute("A","george"); %>..done!<BR>
<BR>
Just to verify, here's A again: <%= session.getAttribute("A") %><BR>
<BR>Now <A href="sessiontest.jsp">reload</A> the page.
</BODY>
</HTML>
--------------------------
When I load the page, everything works as expected. A begins with a null
value, is then set to "george" and this is verified in the last line of
output.
But when I click the link to reload the page, A once again starts as null.
In other words, a new session is created each time the jsp page is loaded.
I have run this exact page under WebSphere 5, and it appeasrs to work as
intended - i.e. the second time the page is loaded, A is already initialized
with "george".
Can anyone tell me what is going on here? What am I doing wrong?
(Please do not ask me to use jsp:useBean - the above is a simplified example
of what I really want to do, which involves setting session attributes from
inside custom tags etc. I really need to set the values using the session
object).
My IE cookie settings are normal, and I'm not using a proxy server.
Mvh
/Michael
www.hyperpal.com