我得到以下编译时错误
call(play.mvc.Http.Context) in actions.Headers cannot override call(play.mvc.Http.Context) in play.mvc.Action
[error] overridden method does not throw java.lang.Exception
[error] public CompletionStage<Result> call(final Http.Context ctx) throws Throwable {
这里是代码:
public CompletionStage<Result> call(final Http.Context ctx) throws Throwable {
ctx.response().setHeader("Access-Control-Allow-Origin", "*");
ctx.response().setHeader("Allow", "*");
ctx.response().setHeader("Access-Control-Allow-Methods", "POST, GET, PUT, DELETE, OPTIONS");
ctx.response().setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Referer, User-Agent, token");
ctx.response().setHeader("Access-Control-Expose-Headers", "Origin, X-Requested-With, Content-Type, Accept, Referer, User-Agent, token");
return (CompletionStage<Result>) delegate.call(ctx);
}
我现在用的打法framework 2.6