Created
August 17, 2011 23:17
-
-
Save biesnecker/1152888 to your computer and use it in GitHub Desktop.
Main method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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