On Sat, 7 Jul 2001, Martin Cooper wrote:

> You can override the setServlet() method to do this. That method is called
> with a non-null value when an instance is being created and initialised, and
> then called again with a null value when the instance is about to be cleaned
> up.
> 

This is the right answer, but I want to add one little warning -- be
*sure* that you call the superclass method!

  public void setServlet(ActionServlet servlet) {

    super.setServlet(servlet);
    ... your custom initialization ...

  }

> --
> Martin Cooper
> 

Craig

> 
> ----- Original Message -----
> From: "Andreas Schildbach" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, July 06, 2001 10:01 AM
> Subject: Where to do the init() for Actions?
> 
> 
> > Is there a similar thing to Servlet.init() in Actions?
> > I want to access EJB's in Actions and have to setup the InitialContext,
> look
> > up some Bean Remote Interfaces, etc. I don't want to do this every time my
> > Action is called.
> > If I were using a plain Servlet, I would put this stuff into init()...
> >
> > Thanks,
> >
> >  - Andreas
> >
> >
> >
> 
> 
> 

Reply via email to