You may use this :
<jsp:useBean id="MB" class="MyBean" scope="application">
<!-- The code written here, will be executed *only* when the bean MB is
created, otherwise, it will be skipped --!>
</jsp:useBean>
Mike Cannon-Brookes wrote:
>
> G'day guys,
>
> How can I work out if a bean has been instantiated?
>
> ie -
>
> fileA.jsp :
> <jsp:useBean id="MB" class="MyBean" scope="application"/>
> <%@ include file="fileB.jsp"%>
>
> fileB.jsp :
> <jsp:useBean id="MB" class="MyBean" scope="application"/>
>
> Sometimes fileB.jsp is included in a file where the bean has already been
> used, hence the variable exists. Othertimes, fileB will be the first to use
> the bean, and will hence create the pointer to it.
>
> Any ideas?
>
> Cheers,
> Mike
> __
> | | The BookmarkBox
> | | http://www.bookmarkbox.com
> |/\| Manage and share your bookmarks online!
>
> Have you seen our new forums? http://www.bookmarkbox.com/ubbcgi
> Share your bookmarking with others and get helpful tips!
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
--
_______________________________________________________________________
---- ---- - --- Stephane Cachat - Developpement JAVA
/ / / / / email : [EMAIL PROTECTED]
---- / / / / tel : +33 (4) 72 69 59 00
/ /\ / / / fax : +33 (4) 72 69 59 01
---- ---\ ---- --- SQLI - 66 quai Ch. de Gaulle - 69006 LYON
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html