-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathLauncher.java
More file actions
23 lines (18 loc) · 812 Bytes
/
Copy pathLauncher.java
File metadata and controls
23 lines (18 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.webapp.WebAppContext;
public class Launcher {
public static void main(String[] args) throws Exception {
Server server = new Server();
SelectChannelConnector connector = new SelectChannelConnector();
connector.setPort(8080);
server.addConnector(connector);
WebAppContext context = new WebAppContext("webapp", "/");
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
// fix for Windows, so Jetty doesn't lock files
context.getInitParams().put("org.eclipse.jetty.servlet.Default.useFileMappedBuffer", "false");
}
server.setHandler(context);
server.start();
}
}