public
Last active

Main method

  • Download Gist
ScalaJetty.scala
Scala
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 26 27 28 29 30 31
package com.biesnecker.scalajetty
 
import cc.spray._
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.xml.XmlConfiguration
import org.eclipse.jetty.webapp.WebAppContext
import java.io.File
 
object ScalaJetty {
 
def main(args: Array[String]): Unit = {
// configure Akka
System.setProperty("akka.config", "etc/akka.conf");
val server = new Server();
val configurationFiles = Array("etc/jetty.xml");
configurationFiles.foreach(file => {
val configuration = new XmlConfiguration(new File(file).toURI().toURL());
configuration.configure(server);
});
val context = new WebAppContext();
context.setServer(server);
context.setWar("webapp");
server.setHandler(context);
server.start();
server.join();
}
 
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.