Playframework 2.0 如何在play framework 2 Java动作合成中禁止返回
我已经创建了新的动作组合,在某些情况下我需要知道如何正确地完成它Playframework 2.0 如何在play framework 2 Java动作合成中禁止返回,playframework-2.0,Playframework 2.0,我已经创建了新的动作组合,在某些情况下我需要知道如何正确地完成它 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);
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();
}
公共类VerboseAction扩展play.mvc.Action.Simple{
public F.Promise调用(Http.Context ctx)抛出可丢弃的{
Logger.debug(ctx.request().username());
//返回委托呼叫(ctx);
禁止返回();
}
}您需要返回一个
承诺
return F.Promise.pure((SimpleResult) forbidden());