tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Haraburda <>
Subject Re: "request.getAttribute()" problems
Date Fri, 20 Jul 2001 17:56:33 GMT
When you say "next page", what do you mean?  How are you going from the first
page to the second page?  This is important because if you are doing it a
certain way (such as a response.sendRedirect) your request object won't get
passed along...


Paul Kofon wrote:

> 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.
> Regards,
> Paul
> _________________________________________________________________
> Get your FREE download of MSN Explorer at

View raw message