因为在Play中已弃用routeAndCall
(特定于Java)等API! 2.1,如何将请求传递给Scala中的另一个控制器?
类似的东西:
def this = Action { implicit request =>
if(request.body) routeAndCall(controller.App.methodWithPostBody)
else Ok("hello")
}
谢谢!
答案 0 :(得分:1)
routeAndCall
方法已弃用的注释提示改为使用route
方法:
@deprecated("Use route instead.", "2.1.0")
答案 1 :(得分:0)
你的用例是什么?你可以使用客户端重定向吗?不推荐使用此方法:如果应用程序在服务器端执行重定向,则客户端将不知道重定向。