/*_##########################################################################
  _##
  _##  Copyright (C) 2012 Kaito Yamada
  _##
  _##########################################################################
*/

package com.github.kaitoy.sneo.giane.jetty;

import java.net.URL;
import java.security.ProtectionDomain;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;

public class GianeStarter {

  public static void main(String[] args) throws Exception {
    Server server = new Server(8080);

    WebAppContext context = new WebAppContext();
    context.setServer(server);
    context.setContextPath("/giane");
    //context.setWelcomeFiles(new String[] {"index.action"});

    ProtectionDomain protectionDomain = GianeStarter.class.getProtectionDomain();
    URL location = protectionDomain.getCodeSource().getLocation();
    context.setWar(location.toExternalForm());

    server.setHandler(context);
    server.start();
    server.join();
  }

}

@@ -486,16 +486,475 @@
 ption %7B%0A
+    int httpPort = 8080;%0A%0A    for (int i = 0; i %3C args.length; i++) %7B%0A      String arg = args%5Bi%5D;%0A      try %7B%0A        if (%22--httpPort%22.equals(arg)) %7B%0A          httpPort = Integer.parseInt(args%5B++i%5D);%0A        %7D else %7B%0A          System.err.println(%22Invalid option: %22 + arg);%0A          System.exit(1);%0A        %7D%0A      %7D catch (Exception e) %7B%0A        System.err.println(%22An error occurred in processing an option: %22 + arg);%0A        System.exit(1);%0A      %7D%0A    %7D%0A%0A
     Serv
@@ -976,20 +976,24 @@
  Server(
-8080
+httpPort
 );%0A%0A    
@@ -1109,70 +1109,8 @@
 e%22);
-%0A    //context.setWelcomeFiles(new String%5B%5D %7B%22index.action%22%7D);
 %0A%0A  

Add an option to specify HTTP port.