gpt4 book ai didi

playframework-2.0 - 如何在 play framework 2 Java Action 组合中禁止返回

转载 作者:行者123 更新时间:2023-12-04 02:40:04 25 4
gpt4 key购买 nike

我创建了新的 Action 组合,在某些情况下我需要禁止返回如何正确执行?

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();
}

最佳答案

您需要返回一个 Promise<SimpleResult> .

return F.Promise.pure((SimpleResult) forbidden());

关于playframework-2.0 - 如何在 play framework 2 Java Action 组合中禁止返回,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20099365/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com