jetty 代码启动

jetty代码启动


jetty 版本为:jetty-distribution-8.1.16.v20140903

  1. public class ServerStart extends Server {
  2. @Test
  3. public void serverStrart() throws Exception {
  4. long begin = System.currentTimeMillis();
  5. Connector connector = new SelectChannelConnector();
  6. connector.setPort(Integer.getInteger("jetty.port", 8888).intValue());
  7. WebAppContext webapp = new WebAppContext("F:/EDev/OA/Code/webapps/OA", "/");
  8. Server server = new Server();
  9. server.setConnectors(new Connector[] { connector });
  10. server.setHandler(webapp);
  11. server.start();
  12. server.join();
  13. System.out.println("Jetty Server started, use " + (System.currentTimeMillis() - begin) + " ms");
  14. }


上一篇:初始CSS3


下一篇:[福大软工] Z班 第6次成绩排行榜