tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Morgenstein" <>
Subject Strange Session Behavior....
Date Wed, 22 Nov 2000 16:03:00 GMT

I am having some problems with retrieving my beans out of sessions on JSP

Some background, I'm using Tomcat 3.2b8 (also tried 3.1) with Apache 1.3.x
on Linux with Sun's JDK1.3.  Under Tomcat 3.2b8, I have disabled cookies and
am using URL rewriting exclusively.

My problem is this.  I have declared the constructor on my Beans as private
(contrary to the Bean pattern, but necessary for subclassing), because at
the start of all operations within my system, I use a factory to construct
the beans based on input parms.  Once I construct the beans, I insert them
into the session using:
   BeanClass instance = BeanClass.getInstance( subclass data );
   session.putValue( "beanName", instance );
In my subsequent JSP pages I am using a useBean syntax with session scope to
retrieve the beans for processing such as:
   <jsp:useBean id="beanName" scope="session"
class="com.recommendit.beans.BeanSubClass"  > </jsp:useBean>

This is working properly for most of my pages and most of my users; however,
I am occasionally getting errors on pages indicating that the bean cannot be
created by the useBean syntax.  This to me says that the bean is not in the

Possible thoughts on the cause of this problem:
1)  I am setting the bean in the session incorrectly (however, it works fine
for the vast majority of my users)
2)  Can the session be getting destroyed by some other outside influence?
3)  ????

Thanks for the help.


View raw message