01: package org.mortbay.jetty.spring;
02:
03: import org.mortbay.jetty.Server;
04: import org.mortbay.resource.Resource;
05: import org.springframework.beans.factory.xml.XmlBeanFactory;
06: import org.springframework.core.io.UrlResource;
07:
08: public class Main {
09: public static void main(String[] args) throws Exception {
10: Resource config = Resource
11: .newResource(args.length == 1 ? args[0]
12: : "etc/jetty-spring.xml");
13: XmlBeanFactory bf = new XmlBeanFactory(new UrlResource(config
14: .getURL()));
15: Server server = (Server) bf.getBean(args.length == 2 ? args[1]
16: : "Server");
17: server.join();
18: }
19: }
|