}
public static void _main(String[] args)
throws Exception {
// Create the server
HttpServer server = new HttpServer();
String portArg = port;
String appDir = "./web";
String webContextDir = appDir + "/WEB-INF/railo";
String serverContextDir = appDir + "/WEB-INF/lib/railo";
if (args.length > 0) {
portArg = args[0];
}
if (args.length > 1) {
appDir = args[1];
webContextDir = appDir + "/WEB-INF/railo";
serverContextDir = appDir + "/WEB-INF/lib/railo-server";
}
if (args.length > 2) {
webContextDir = args[1];
}
if (args.length > 3) {
serverContextDir = args[2];
}
// Create a port listener
SocketListener listener = new SocketListener();
int port = Integer.parseInt(portArg);
listener.setPort(port);
server.addListener(listener);
String host = null;
// Create a context
File webxml = new File(appDir + "/WEB-INF/web.xml");
if (webxml.exists()) {
addWebXmlContext(server, "/", host, "/", appDir, webContextDir, serverContextDir);
} else {
addContext(server, "/", host, "/", appDir, webContextDir, serverContextDir);
}
//addContext(server,"/susi/","localhost","/jm/",null,null);
//addContext(server,"/sub1/","localhost","/subweb1/",null,null);
//addContext(server,"/sub2/","localhost","/subweb2/",null,null);
//addContext(server,"/","192.168.2.104","/",null,null);
//addContext(server,"/","context.example.local","/",null);
//addContext(server,"/","7of9","/",null);
//for(int i=1;i<10;i++)
// addContext(server,"/","context"+i+".example.local","/context"+i+"/",null,null);
server.start();
if ( host != null && !host.isEmpty() )
DesktopUtil.launchBrowser( host, port, false );
}