开发者

How to call action that is in a different controlle in play framework?

开发者 https://www.devze.com 2023-03-17 19:56 出处:网络
I have a controller Foo in play framework scala project: In Foo controller (in Foo.scala) I have action

I have a controller Foo in play framework scala project:

In Foo controller (in Foo.scala) I have action 
object Foo extends Controller { 
def baz() = { 
 Application.bar开发者_如何转开发() 
} 

In baz action I want to call bar action defined in controller Application (in controllers.scala) . But above does not work as I get compile error Application.bar does not take parameters.


Try with:

Action(Application.bar)
0

精彩评论

暂无评论...
验证码 换一张
取 消