tomcat-users mailing list archives

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

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

Hope this helps


-----Original Message-----
From: Dominic Parry []
Sent: Monday, 9 June 2003 7:00 PM
To: Tomcat Users List
Subject: Tomcat destoying beans


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?!



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message