Skip to content

Instantly share code, notes, and snippets.

@ivarconr
Created October 12, 2012 09:52
Show Gist options
  • Save ivarconr/3878454 to your computer and use it in GitHub Desktop.
Save ivarconr/3878454 to your computer and use it in GitHub Desktop.
Start embedded Jetty 8 with web-context
//jetty.version 8.1.7.v20120910
public static void main(String[] args) throws Exception {
Server server = new Server(3000);
WebAppContext context = new WebAppContext();
context.setDescriptor(context+"/WEB-INF/web.xml");
context.setResourceBase("./src/main/webapp");
context.setContextPath("/");
context.setParentLoaderPriority(true);
server.setHandler(context);
server.start();
server.join();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment