The Spray-template jetty example comes with a web.xml configuration. If embedded is more your style, this is the way to go (Jetty 8.1.7):

package com.example
import spray.servlet.Servlet30ConnectorServlet
import spray.servlet.Initializer
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.server.bio.SocketConnector
import org.eclipse.jetty.webapp.WebAppContext
import org.eclipse.jetty.servlet.ServletContextHandler
object JettyServer {
def main(args : Array[String]) : Unit = {
start()
}
def start() {
try {
val server = new Server()
val connector = new SocketConnector();
connector.setPort(8080);
val context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");
server.setHandler(context);
context.addEventListener(new Initializer());
val servletHolder = context.addServlet(classOf[Servlet30ConnectorServlet].getName(), "/*");
server.setConnectors(Array(connector));
server.start();
} catch {
case e:Throwable => e.printStackTrace();
}
}
}
view raw gistfile1.scala hosted with ❤ by GitHub


If you want to use markdown for a single page, you can use markdown.js to interpret a markdown file (I've called mine index.md) loaded with jquery:

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="http://raw.github.com/evilstreak/markdown-js/master/lib/markdown.js"></script>
</head>
<body>
<div id="docs"> </div>
<script>
$.get("index.md", function(markdownText) {
document.getElementById('docs').innerHTML = markdown.toHTML(markdownText);
},"text");
</script>
</body>
</html>
view raw gistfile1.html hosted with ❤ by GitHub



After installing Ensime, ScalaTest and Maven in Sublime, I still hadn't got the continuous compile I had in Emacs with sbt, until I heard about the fsc option in the scala maven compiler.  Now each save compiles fast and is ready for an immediate run with the ScalaTest plugin.

<profiles>
<profile>
<id>scalac-prod</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<fsc.once>true</fsc.once>
<fsc.compilation>all</fsc.compilation>
</properties>
</profile>
<profile>
<id>scalac-dev</id>
<properties>
<fsc.once>false</fsc.once>
<fsc.compilation>modified-only</fsc.compilation>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>cc</id>
<goals>
<goal>cc</goal>
</goals>
<phase>compile</phase>
<configuration>
<useFsc>true</useFsc>
<once>${fsc.once}</once>
<recompileMode>${fsc.compilation}</recompileMode>
</configuration>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<useFsc>true</useFsc>
<once>${fsc.once}</once>
<recompileMode>${fsc.compilation}</recompileMode>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
view raw gistfile1.xml hosted with ❤ by GitHub