Nicholas C. Zakas
Nicholas C. Zakas

Reputation: 21

How to get beforeActionInvocation and afterActionInvocation to be called in Play module?

I'm working on building my first Play module. I used another module as an example and created a Plugin.java class to serve as my main interface. I can access the methods on this class easily from my tags, but it seems that the object is not going through the normal lifecycle. Specifically, beforeActionInvocation() and afterActionInvocation() are never being called.

This module is more or less a stub right now, created via "play new-module" and I've not modified any of the default files (though I have added this class and some tags).

My question is: what causes a Plugin class to go through the normal plugin lifecycle, as it seems mine is not? Is there some configuration I'm missing?

Upvotes: 2

Views: 636

Answers (1)

niels
niels

Reputation: 7309

You must have a subclass of PlayPlugin and a file play.plugins in your classpath, where you register it with

1003:myPackage.MyPlugin

Upvotes: 2

Related Questions