public void StartWebService() throws Exception
    {
        JettyHTTPServerEngineFactory eg = new JettyHTTPServerEngineFactory();
        eg.createJettyHTTPServerEngine(9000,"http");
        
        
        WebServiceMethod webServiceMethod = new WebServiceMethod();
        ServerFactoryBean svrFactory = new ServerFactoryBean();
        svrFactory.setServiceClass(WebServiceMethod.class);
        svrFactory.setAddress("http://localhost:9000/Hello");
        svrFactory.setServiceBean(webServiceMethod);
        // svrFactory.getServiceFactory().setDataBinding(new
        // AegisDatabinding());    
        svrFactory.create();
    }


 

http://cxf.547215.n5.nabble.com/Virtual-host-with-jetty-standalone-RS-WS-need-help-td3414715.html

 

 

From Java, I THINK you can do something like:

bus.getExtention(JettyHTTPServerEngine.class)
     .createJettyHTTPServerEngine(null, 8080, "http");

and that will create the connector for the port on all hosts, not the one for
the passed in host.    Not 100% sure though.
 

 

posted on 2011-04-19 12:09  白沙河  阅读(515)  评论(1编辑  收藏  举报