Gilad, I don't think that code is correct, I think it should be:
ServletHolder holder = new ServletHolder(new MyServlet()); holder.setInitOrder(0); context.addServlet(holder, "/myServlet/*"); Jan On 27 March 2012 21:24, Gilad Barkai <[email protected]> wrote: > Hi, > > I'm using embedded Jetty (6.1.26), and would like a servlet to start right > when the server is starting up - rather than the lazy initialization upon > request. > I tried different approaches none succeeded. > Original code looks like this: > > Server server = new Server(7000); > Context context = new Context(server, "/", Context.SESSIONS); > context.addServlet(new MyServlet(), "/myServlet/*"); > server.start(); > > > This defaults to the lazy initalization. > In order to force init on start, I tried the following approaches without > success: > > starting the context separately > .setInitOrder(0) > moved to ServletHolder and call its .start() > moved to ServletHandler and use .setInitializeAtStart(true) > > > Is it possible to force such init-on-startup? > If so, I would appreciate any clues. > > Thanks, > Gilad Barkai. > > _______________________________________________ > jetty-users mailing list > [email protected] > https://dev.eclipse.org/mailman/listinfo/jetty-users > _______________________________________________ jetty-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/jetty-users
