に共通の機能を呼び出す私がプレイFrameworkの次のアクションを持っている:はプレイ
def action = Action { request =>
common1() // this is common to all the actions
// some functions specific to the action
var json = common2() // this is common to all the actions
Ok(json)
}
は、私は自分のアプリケーションで多くのアクションを持っています。私の問題は、すべてのアクションでcommon1
とcommon2
が呼び出されているため、呼び出しを繰り返したくないということです。このシナリオを処理するには、どのような良い方法がありますか?
が重複する可能性を:アクション構成を実装する方法](http://stackoverflow.com/questions/25105558/play-how-to-implement-action-composition) – cchantep