From tomcat-user-return-41877-apmail-jakarta-tomcat-user-archive=jakarta.apache.org@jakarta.apache.org Fri Jul 20 20:54:59 2001 Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 63576 invoked by uid 500); 20 Jul 2001 20:54:59 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 63569 invoked from network); 20 Jul 2001 20:54:58 -0000 Received: from unter.loudeye.com (216.10.241.2) by h31.sny.collab.net with SMTP; 20 Jul 2001 20:54:58 -0000 Received: from tsexch01.int.loudeye.com (cerberus.loudeye.com [209.221.170.2]) by unter.loudeye.com (8.10.1/8.10.1) with ESMTP id f6KKrZ825912 for ; Fri, 20 Jul 2001 13:53:35 -0700 (PDT) Received: by tsexch01.int.loudeye.com with Internet Mail Service (5.5.2653.19) id <3TKMTKRY>; Fri, 20 Jul 2001 13:52:43 -0700 Message-ID: From: Jann VanOver To: "'tomcat-user@jakarta.apache.org'" Subject: RE: "request.getAttribute()" problems Date: Fri, 20 Jul 2001 13:52:43 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Then the bean must be in the SESSION scope Putting it in the REQUEST scope means -- "keep it around with this request" When you go to a new JSP page you usually get a new request to go with it. -----Original Message----- From: Paul Kofon [mailto:pkofon@hotmail.com] Sent: Friday, July 20, 2001 11:05 AM To: tomcat-user@jakarta.apache.org Subject: Re: "request.getAttribute()" problems Hi David, On the first page, I've got a form with an action pointing to a certain jsp page. It's on this page (the one pointed to in the action statement) that I try to retrieve the object. Does that make any sense? Regards, Paul >From: David Haraburda >Reply-To: tomcat-user@jakarta.apache.org >To: tomcat-user@jakarta.apache.org >Subject: Re: "request.getAttribute()" problems >Date: Fri, 20 Jul 2001 12:56:33 -0500 > >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... > >David > >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 >http://explorer.msn.com/intl.asp > _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp