play1 には下記四種類のインターセプターが用意されています。
@Before
@After
@Check
@Finally
同じインターセプターを複数個設定した場合の実行順序について、ドキュメントには @Check
のみ記載がありますが、これら全てのインターセプターで priority
属性が指定できます。
public class SomeController extends Controller {
@Before(priority = 0)
public static void highPriorityMethod() {
Logger.debug("this method should be called first.");
}
@Before(priority = 1)
public static void lowPriorityMethod() {
Logger.debug("and then, this method will be called.");
}
}