私は記事の本文のEntityを見て特定の統計を計算するはずのdropwizardを使用してRequestDispatcherを実装しようとしています。jersey requestdispatcher実行命令
ので、私は、私はすでに(理解)本文を読んでいるので、上記のコードは、例外をスローし、
private static class InspectRequestDispatcher implements RequestDispatcher {
private final RequestDispatcher dispatcher;
private InspectRequestDispatcher(RequestDispatcher dispatcher) {
this.dispatcher = dispatcher;
}
@Override
public void dispatch(final Object resource, final HttpContext context) {
final Saying day = context.getRequest().getEntity(Saying.class);
dispatcher.dispatch(resource, context); // this throws ConstraintViolationException
}
}
をResourceMethodDispatchAdapter
を実施し、ResourceMethodDispatchProvider
と私は正常に私のRequestDispatcherを注入して呼び出すことができています私はストリームをリセットすることができますが、私は体を2回読むためのペナルティを支払うことになります。
AFTERパラメータを注入したメソッド呼び出しをインターセプトすることは可能ですか?どういうわけかこのインターセプタを最後のものにスケジュールしますか?
あなたの代わりにRequestDispatcher
のContainerRequestFilter
を使用した場合dropwizard 7バージョン