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 | public class JettyServer { public static void main(String[] args) { Server server = new Server(8080); server.setHandler(new DefaultHandler()); XmlConfiguration configuration = null; try { configuration = new XmlConfiguration( new FileInputStream("C:/development/Jetty/jetty-6.1.6rc0/etc/jetty.xml")); } catch (FileNotFoundException e1) { e1.printStackTrace(); } catch (SAXException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } try { configuration.configure(server); server.start(); } catch (Exception e) { e.printStackTrace(); } } } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |