Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Example of creating webapp in XML

I need to configure a webapp, and would like to do it using a jetty xml configuration file.

The normal way to do it is to have a webapps directory that gets scanned for WEB-INF/web.xml, but that turns out to be inconvenient for this particular application. Also, I think I know how to do it programmatically, but I'm really trying to keep all configuration in XML so it can be modified by my customers.

The old XML that handles contexts doesn't work in Jetty 9 any more.

My guess is that I have to create a org.eclipse.jetty.webapp.WebAppContext, register a servlet with it, and somehow apply it to the Server, but the magic syntax eludes me.

Does anyone have an example?



Back to the top