tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Lunnon" <b...@mirrim.com.au>
Subject RE: Tomcat destoying beans
Date Mon, 09 Jun 2003 09:28:18 GMT
Dominic,

You haven't set the session in the page declaration
<%@page session=true ...


Hope this helps

Bill

-----Original Message-----
From: Dominic Parry [mailto:dom@rucus.ru.ac.za]
Sent: Monday, 9 June 2003 7:00 PM
To: Tomcat Users List
Subject: Tomcat destoying beans


Hi

After I call a servlet that accesses two beans created in a jsp, the beans
seem to have been destroyed.

They are created like this:

<%@ page import="beans.*"%>
<jsp:useBean id="authBean" scope="session" class="beans.UserAuth"/>
<jsp:useBean id="dataBean" scope="session" class="beans.DataBean"/>

this page then response.sendRedirect("MyServlet");

code in MyServlet:

 session = req.getSession();
 UserAuth authBean = (beans.UserAuth) session.getAttribute("authBean");
 DataBean dataBean = (beans.DataBean) session.getAttribute("dataBean");

I am able to access these beans in the servlet, but once it has finished
execution, they seem to have been garbage collected!

What am I missing?!

Thanks

Dom


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message