tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Kofon" <>
Subject "request.getAttribute()" problems
Date Thu, 01 Jan 1970 00:00:00 GMT
Hi all,

I have a Bean whose scope I would like to set to "request". I would like to 
retrieve this Bean's instance when the next page is requested.
On the first page, I have:

< jsp:useBean id="beanclass" class="BeanClass" scope="request" />

On the next page, I have:

BeanClass b = (BeanClass) request.getAttribute("beanclass");

However, when I try to use instance "b" of my Bean,  I get a 
NullPointerException. The strange thing is that the code seemed to working 
in Orion. Is there something I'm doing wrong?
Note that I can use the instance without errors when I set the scope to 
"session" and use "session.getAttribute()" instead but I don't want to do 
this as my instance should only last for a request.
I'm using Tomcat 3.2.2/Sun's JDK 1.3.1 on Win2K Pro.



Get your FREE download of MSN Explorer at

View raw message