ann
          冰是沒有未來的,因?yàn)樗挠篮?/span>
          posts - 107,comments - 34,trackbacks - 0
          public class RestaurantCenterJettyStarter {
              
          public static void main(String[] args) {
                  
          long start = System.currentTimeMillis();
                  
          try {
                      
          // set up files and urls
          //            URL[] urls;
          //            {
          //                urls = RefreshingURLClassLoader.getReloadableUrls();
          //            }

                      
          // deal with classloader
          //            ClassLoader parent = Thread.currentThread().getContextClassLoader();
                      
          //
                      
          // eclipse will recompile the class. so I disable this
                      
          //
                      
          // for (int i = 0; i < files.length; i++) {
                      
          // File file = files[i];
                      
          // CompilingClassLoader ccl = new CompilingClassLoader(parent,
                      
          // file);
                      
          // ccl.start();
                      
          // parent = ccl;
                      
          // }
          //            URLClassLoader urlCloader = new RefreshingURLClassLoader(urls, parent);
          //            Thread.currentThread().setContextClassLoader(urlCloader);

                      
          // finally, start the server!
                      Server server = new Server();
                      SelectChannelConnector connector 
          = new SelectChannelConnector();
                      connector.setPort(
          8080);
                      connector.setReuseAddress(
          false); //這樣就不能重復(fù)啟動(dòng)同一個(gè) jetty 了. jetty starter 不檢查 端口是否被占用
                      server.setConnectors(
          new Connector[] { connector });

                      
          // WebAppContext wac4 = new WebAppContext("./chatty", "/chatty");
                      
          // WebAppContext wac = new WebAppContext("/s100-webdata/photo",
                      
          // "/photo");
                      
          // WebAppContext wac2 = new WebAppContext("/s100-webdata/photo",
                      
          // "/video");
                      WebAppContext wac3 = new WebAppContext("./web""/RestaurantCenter");

                      
          // wac.setClassLoader(urlCloader);
                      
          // wac2.setClassLoader(urlCloader);
          //            wac3.setClassLoader(urlCloader);
                      
          // wac4.setClassLoader(urlCloader);

                      ContextHandlerCollection contexts 
          = new ContextHandlerCollection();
                      contexts.setHandlers(
          new Handler[] { wac3, /* wac, wac2,wac4 */}); // the
                      
          // order
                      
          // doesn't
                      
          // matter

                      HandlerCollection handlers 
          = new HandlerCollection();
                      handlers.setHandlers(
          new Handler[] { contexts, new DefaultHandler() });

                      server.setHandler(handlers);
                      server.start();
                      
          long duration = System.currentTimeMillis() - start;
                      System.out.println(
          "啟動(dòng) Jetty 服務(wù)器 in " + duration + "ms");
                      System.out.println(
          "Web Service is @ http://localhost:8080/RestaurantCenter/RestaurantWebService?wsdl" );
                  } 
          catch (Exception e) {
                      e.printStackTrace();
                  }

              }
          }

          當(dāng)下,把心放下 放下如果是可能的,那一定是在當(dāng)下,
          不在過去,也不在未來。
          當(dāng)下放下。唯有活在當(dāng)下,你的問題才能放下。

          主站蜘蛛池模板: 兴安县| 峡江县| 三明市| 凉城县| 会泽县| 高清| 宁武县| 泰来县| 婺源县| 习水县| 陆河县| 来宾市| 辽阳市| 昭苏县| 永福县| 巢湖市| 柳林县| 江门市| 宣城市| 海淀区| 三门县| 灵武市| 宜兴市| 攀枝花市| 苍梧县| 大港区| 东辽县| 广元市| 合作市| 屏东县| 准格尔旗| 洪泽县| 潼南县| 保山市| 遵义县| 信丰县| 滕州市| 郓城县| 乐亭县| 牟定县| 西平县|