首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到参数封送器的隐式值: spray.httpx.marshalling.ToResponseMarshaller[Unit]

找不到参数封送器的隐式值: spray.httpx.marshalling.ToResponseMarshaller[Unit]
EN

Stack Overflow用户
提问于 2015-10-28 06:26:46
回答 1查看 357关注 0票数 1

我有以下代码要执行:

代码语言:javascript
复制
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)
                    }


                }   
            }
        } 
    }
}

}

复杂时,错误是:无法为参数封送器找到隐式值: spray.httpx.marshalling.ToResponseMarshallerUnit错误at: testing(alertC,alertB)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-10-28 06:34:28

喷雾无法找到用于Unit的封送器。例如,从testing返回一个字符串。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33384281

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档