Sorry for the late response.  If I'm understanding what you want, it's a bit
problematic for a Bean.  But a first try is something like:

<jsp:useBean id="termWatch" class="termwatch.TermWatchBean"
scope="session"/>
  <jsp:setProperty name="termWatch" property="application" value="<%=
application %>" />
</jsp:useBean>

The setApplication method of TermWatchBean would check if the properties are
already defined in the ServletContext, and act accordingly.

Of course, I can see infinite variations on this theme.  If this isn't the
one you want, please reply with more detail.

"Jeff Ousley" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Bill,
>
> Is there a way to make the constructor in the bean
> global to all sessions? Is there some other mechanisim
> that allows for this? I want to initialize some
> objects that will exist for all users of a .jsp page.
> How do I go about doing this?
>
> thanks!
> -jeff
> --- Bill Barker <[EMAIL PROTECTED]> wrote:
> >
> > "Jeff Ousley" <[EMAIL PROTECTED]> wrote in message
> >
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Hello!
> > >
> > > Is there a method I can override in a bean that'll
> > get
> > > executed when a bean is first used and not on
> > > subsequent calls? Basically I'm page that uses a
> > bean
> > > such as:
> > >
> > > <jsp:useBean id="termwatch"
> > > class="termwatch.TermWatchBean" scope="session"/>
> > >
> > > In order to use the termwatch bean some code
> > inside
> > > the bean needs to be executed first. I can create
> > a
> > > method and explicitly call it, but is there a
> > better
> > > way? Do beans have cnstructors? Or should I be
> > > handling this on my page in a jspInit() method?
> > >
> >
> > It is perfectly legal to specify a constructor for
> > your bean, as long as it
> > takes no arguments.
> >
> > > thanks!
> > > -jeff
> > >
> > > __________________________________________________
> > > Do you Yahoo!?
> > > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> > now.
> > > http://mailplus.yahoo.com
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to