Skip to main content

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

Maybe looking at the embedded code examples for jetty-9 will help, as the xml <-> code is pretty straightforward. Here's a single webapp deployed to a server:

https://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/examples/embedded/src/main/java/org/eclipse/jetty/embedded/OneWebApp.java

And the xml reference for jetty-9:

http://www.eclipse.org/jetty/documentation/current/reference-section.html#jetty-xml-syntax

The jetty-9 docs are a work in progress so check back frequently for updates.

cheers
Jan


On 15 November 2012 07:41, ccleve <ccleve.tech@xxxxxxxxx> wrote:
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?

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



--
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com – Developer advice, services and support
from the Jetty & CometD experts.

Back to the top