changeset 25:41bb4358478e

+ unfiltered + example
author Alexandre Bertails <bertails@w3.org>
date Mon, 08 Aug 2011 15:44:13 -0400
parents 943aa66639b2
children c9e5c04f2fad
files project/Build.scala src/main/scala/Main.scala
diffstat 2 files changed, 44 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/project/Build.scala	Mon Aug 08 14:19:30 2011 -0400
+++ b/project/Build.scala	Mon Aug 08 15:44:13 2011 -0400
@@ -18,6 +18,9 @@
     "file://" + local.getAbsolutePath
   }
 //  val time = "org.scala-tools.time" %% "time" % "0.5-SNAPSHOT"
+   val unfiltered_filter = "net.databinder" %% "unfiltered-filter" % "0.4.1"
+   val unfiltered_jetty = "net.databinder" %% "unfiltered-jetty" % "0.4.1"
+   val avsl = "org.clapper" %% "avsl" % "0.3.1"
 }
 
 object BuildSettings {
@@ -45,12 +48,16 @@
     Seq(
       resolvers += ScalaToolsReleases,
       resolvers += ScalaToolsSnapshots,
+//      resolvers += "java m2" at "http://download.java.net/maven/2",
 //      resolvers += "Scala Tools Nexus" at "http://nexus.scala-tools.org/content/repositories/snapshots/",
       libraryDependencies += scalatest,
       libraryDependencies += antiXML,
       libraryDependencies += jodatime,
       libraryDependencies += dispatch,
-      libraryDependencies += saxon
+      libraryDependencies += saxon,
+      libraryDependencies += unfiltered_filter,
+      libraryDependencies += unfiltered_jetty
+//      libraryDependencies += avsl
     )
 
   lazy val pubrules = Project(
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/scala/Main.scala	Mon Aug 08 15:44:13 2011 -0400
@@ -0,0 +1,36 @@
+package org.w3.prc
+
+import unfiltered.request._
+import unfiltered.response._
+
+import java.io._
+import java.net._
+
+object Danseur {
+
+  def main(args: Array[String]) {
+
+    val resp = new ResponseStreamer {
+      def stream(os:OutputStream):Unit = {
+        val data = new DataOutputStream(os)
+        data.writeUTF("les danseurs sont dans le coin")
+
+//        xslt.setOS(os)
+
+      }
+    }
+
+    val echo = unfiltered.filter.Planify {
+      case Path(Seg(p :: Nil)) => ResponseString(p)
+    }
+
+    val test = unfiltered.filter.Planify {
+      case Path(Seg("test" :: Nil)) => resp
+    }
+    
+    unfiltered.jetty.Http.local(2719).filter(test).filter(echo).run()
+
+
+  }
+
+}
Set up and maintained by W3C Systems Team, please report bugs to sysreq@w3.org.

W3C would like to thank Microsoft who donated the server that allows us to run this service.