Skip to content

Instantly share code, notes, and snippets.

@marko-asplund
Created July 19, 2013 20:34
Show Gist options
  • Select an option

  • Save marko-asplund/6042147 to your computer and use it in GitHub Desktop.

Select an option

Save marko-asplund/6042147 to your computer and use it in GitHub Desktop.
Using Jersey 2 Spring integration prototype with Jetty 9 embedded (with servlet 3.0 annotation support)
package fi.markoa.proto.jersey2.jetty;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.Configuration;
import org.eclipse.jetty.webapp.WebAppContext;
public class JettyWebApp {
public static void main(String ... args) throws Exception {
Server server = new Server(8090);
Configuration.ClassList classlist = Configuration.ClassList.setServerDefault(server);
classlist.addBefore("org.eclipse.jetty.webapp.JettyWebXmlConfiguration", "org.eclipse.jetty.annotations.AnnotationConfiguration");
WebAppContext webapp = new WebAppContext();
webapp.setContextPath("/app1");
webapp.setWar("/foo/bar/jersey/examples/helloworld-spring/target/helloworld-spring.war");
server.setHandler(webapp);
server.start();
server.join();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment