On Thu, 6 Feb 2003, Heligon Sandra wrote:
> Date: Thu, 6 Feb 2003 15:01:44 +0100 > From: Heligon Sandra <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]> > To: 'Struts Users Mailing List' <[EMAIL PROTECTED]> > Subject: RE: Application Startup > > The problem with the ServletContextListener is that we can not > display error to the client if an error occur, isn'it ? > If you're doing things at application startup, there *are* no users yet. A ServletContextListener.contextCreated() method that detects an error should write messages to the appropriate log file to describe what happened (for example, you could call ServletContext.log() for this), plus throw an exception back to the container. That will cause the container to not put the application into service, because something was wrong at startup time. In a Servlet 2.2 environment, you'd do exactly the same sort of thing, but in t he init() method of a servlet marked for <load-on-startup> instead. In either case, the initialization will have been completed by the container before the application is allowed to start processing requests. Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

