-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi,
you need to insert something like this :
<listener>
        <listener-class>
        com.your.package.YourContextListener
        </listener-class>
</listener>

your servlet class might look something like this :
import javax.servlet.*;

public final class MyContextListener implements ServletContextListener
{
    private ServletContext context = null;
    public void contextInitialized(ServletContextEvent event) {
        this.context = event.getServletContext();
        yourService.start();
    }
    public void contextDestroyed(ServletContextEvent event) {
        this.context = null;
        yourService.stop();
    }
}


hope it helps
- -reynir





Michael Niemaz wrote:
> Thanx Reynir, it helps ... although I wouldn't mind if you could give me
> more details ;-)
> I have many web services that are initialised only when invoked the
> first time.
> I must admit that this init part looks a bit confused to me.
> Any example based on servlet or singleton would be very much appreciated
> ;-)
> 
> Thanx,
> 
> --mike
> 
> Reynir Hubner wrote:
> 
> there are several implementations of webservices available. the one most
> successfull is axis from apache, you should read all about it on the
> axis website..
> http://ws.apache.org/axis/
> 
> of course it dependes on what you are going to do, but starting some
> service at application-startup can be done via web.xml (of your
> application) either by a custom listener or servlet loading up your
> service, sometimes done by using a singleton.
> 
> hope it helps
> -reynir
> 
> 
> Michael Niemaz wrote:
>  
> 
>>>> Hi all,
>>>>   Could someone explain me or point me to an explanation of how tomcat
>>>> initialize web services? I'd like to initialize them automatically at
>>>> tomcat start-up instead of just before their invocation.
>>>>
>>>> Thanx,
>>>>
>>>> --mike
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>>   
> 
>>
- ---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>

>>

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


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDegnk19KgIQihNwgRAnOAAKCU3U9jaTj0swmjKQyesb/Suzn+fACgxRLS
D/gYAtomCIdqnmqZK201ULk=
=EdDB
-----END PGP SIGNATURE-----

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

Reply via email to