I don’t quite understand what the @with annotation does.
in the Play framework site, it is written :
we can annotate the controllers using the @With annotation to tell
Play to invoke the corresponding interceptors
is it the same as inheritance ? will it invoke @before of the given class parameter ? what exactly does it do ?
The best way I can describe it, is that it kind of gives you multiple inheritance at your controller level for your interceptors. Interceptors being the
@Before,@Afterannotations.You could therefore
@Beforeannotations@Beforeyou could then define a controller or controllers that contained all your actions, and use the
@Withannotation to make use of the two controllers described above. It means you can separate your code out cleanly, and not have to rely on inheritance to execute the@Beforeannotations.