Yes you would need to declare the jsp:useBean tag in jsp2 as well.
<jsp:useBean id="foo" scope="application" class="test.ReportHandler" />
But because you have created the foo object iwith assplication scope, the
above tag will not instantiate a new bean object but get it from the
application context.
Have a nice day.
With regards,
Sachin S. Khanna.
www.emailanorder.com
----- Original Message -----
From: Tiana Zhang <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 12, 2000 2:20 AM
Subject: HELP!! What's wrong with my "application" scope
> Hello, I have the a question about the application scope of JSP.
> I have two jsp pages. in jsp1, I declared sth like:
>
> <jsp:useBean id="foo" scope="application" class="test.ReportHandler" />
> ..
> ..
> foo.setDomain(mydomain);
> ..
>
> in jsp2 I tried to retrieve the "domain" property set by jsp1. Because the
scope
> is application, I surpose to be able to get it. I did the following in
jsp2:
> ..
> out.println(foo.getDomain())
> ..
>
> THe result from jsp2 is alway null. It seems like they didn't share the
same foo
> object. Is there anything wrong? or I need to redeclare
> <jsp:useBean id="foo" scope="application" class="test.ReportHandler" />
> in jsp2?
>
> Really appreiciate for your help.
>
> Tiana
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets