[英]could not find implicit value for parameter marshaller: spray.httpx.marshalling.ToResponseMarshaller[Unit]
i have following code to execute: 我有以下代码要执行:
import akka.actor.ActorSystem
import spray.routing.SimpleRoutingApp
import spray.json.DefaultJsonProtocol._
object Server1 extends App with SimpleRoutingApp{
def testing(p:String,q:String){
println(p+" "+q)
}
implicit val actorSystem = ActorSystem()
var state:String=""
startServer(interface="localhost",port = 8080){
println("Listening...")
get{
println("incoming..")
path("state"){
parameters("alertC".as[String],"alertB".as[String]){ (alertC,alertB)=>{
complete{
testing(alertC,alertB)
}
}
}
}
}
}
} }
at complie time the error is: could not find implicit value for parameter marshaller: spray.httpx.marshalling.ToResponseMarshaller[Unit] error at: testing(alertC,alertB) 在编译时错误为:找不到参数marshaller的隐式值:spray.httpx.marshalling.ToResponseMarshaller [Unit]错误于:testing(alertC,alertB)
Spray cannot find a marshaller for Unit
. Spray找不到Unit
的编组。 Return a string from testing
, for example. 例如,返回来自testing
的字符串。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.