Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Main method

View ScalaJetty.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();
}
 
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.