-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRunManager.java
More file actions
30 lines (24 loc) · 799 Bytes
/
RunManager.java
File metadata and controls
30 lines (24 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.lgcns.test;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.servlet.ServletHandler;
public class RunManager {
private static final String host="127.0.0.1";
private static final int port =8080;
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
new RunManager().start();
}
public void start() throws Exception{
Server server= new Server();
ServerConnector http = new ServerConnector(server);
http.setHost(host);
http.setPort(port);
server.addConnector(http);
ServletHandler servletHandler = new ServletHandler();
servletHandler.addServletWithMapping(MyServlet.class, "/");
server.setHandler(servletHandler);
server.start();
server.join();
}
}