Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How return forbidden in play framework 2 Java action composition

I have created new action composition and in some cases i need return forbidden how to do it correctly ?

public class VerboseAction extends play.mvc.Action.Simple {
public F.Promise<SimpleResult> call(Http.Context ctx) throws Throwable {
    Logger.debug(ctx.request().username());

    //return delegate.call(ctx);
    return forbidden();
}

}

like image 668
user3013601 Avatar asked Sep 15 '26 12:09

user3013601


1 Answers

You need to return a Promise<SimpleResult>.

return F.Promise.pure((SimpleResult) forbidden());
like image 190
mantithetical Avatar answered Sep 17 '26 13:09

mantithetical