Created
April 5, 2013 22:47
-
-
Save raymyers/5323304 to your computer and use it in GitHub Desktop.
Embedded server with Jetty 9, including filelock workaround.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.cadrlife; | |
| import org.eclipse.jetty.server.Server; | |
| import org.eclipse.jetty.webapp.WebAppContext; | |
| public class EmbeddedJetty9Server { | |
| // compile 'org.eclipse.jetty:jetty-server:9.0.0.v20130308' | |
| // compile 'org.eclipse.jetty:jetty-webapp:9.0.0.v20130308' | |
| public static void main(String[] args) throws Exception { | |
| Server server = new Server(8080); | |
| WebAppContext webapp = new WebAppContext(); | |
| webapp.getInitParams().put("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false"); | |
| webapp.setContextPath("/myapp"); | |
| webapp.setWar("src/main/webapp"); | |
| 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