From: Greg W. <gr...@mo...> - 2004-01-31 02:21:39
|
Chris, to do this, you would need to not call addWebApplications in jetty.xml - so that no web applications get created. Then add a Context at / with a single handler that you will have to write yourself. This handler will need to look for an applicable webapp for each request, if it finds one, it can call addWebApplication and then dispatch the request to it. Other wise it can 404 the request. regards Chris wrote: > I'm using Jetty as an embedded server. I create a org.mortbay.jetty.Server > object, and then specify a webapps directory: > > server.addWebApplications(null, // virtual host > homeDir + "webapps/", // webapps dir > homeDir + "webapps/root/WEB-INF/webdefault.xml", // defaults > true); // extract wars > > server.start(); > > This causes all webapps to be loaded on startup. The log gets entries like > this: > > 20:32:59.298 EVENT > [main]org.mortbay.http.HttpContext.start(HttpContext.java:1901)22> Started > WebApplicationContext[/mysite,file:/C:/mydir/webapps/mysite/] > > I'd prefer that the system ignore the contents of the webapps directory > until a user actually makes a request for a particular webapp (by issuing an > http request from a browser). Is there any way to do this? > > My webdefaults.xml look just like the default that comes with Jetty. It has > <load-on-startup>0</load-on-startup> in a couple of places. I'm using Jetty > 4.2.15. > > > > > > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Jetty-support mailing list > Jet...@li... > https://lists.sourceforge.net/lists/listinfo/jetty-support > |