You'll get two beans, one in the application, one in the request, with the
same name.

BEWARE

<jsp:useBean ... type=""
AND
<jsp:useBean ... class=""

have different behaviour.

In the second case the useBean tag will create the bean, in the first case
it will only reference an already existing bean,

Kevin Jones
DevelopMentor
www.develop.com

> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> fumitada
> Sent: 30 January 2001 11:14
> To: [EMAIL PROTECTED]
> Subject: Re: I don't understand scope in jsp.
>
>
> Thank you, kevin
>
> I tried what you wrote, and it worked !
> now I got a new question.
>
> If I declare like below
> <jsp:useBean id="catAndSub" type="CatAndSub" scope="application" /> in a
> jsp.
> <jsp:useBean id="catAndSub" type="CatAndSub" scope="request" /> in the
> other jsp.
>
> The first one's scope is application and second one's is request.
>
> What's gonna happen ?
>
> >In a servlet try
> >CatAndSub catAndSub = getServletContext().getAttribute("catAndSub");
> >carAndSub.getXXX();
> >in a JSP
> ><jsp:useBean id="catAndSub" type="CatAndSub" scope="application" />
> ><% catAndSub.getXXX(); %>
>
> Thanks in advance.
>
> __________________________________________________________________
> _________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
> in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to