4

@InitBinderSpring Boot アプリケーションをデバッグしているときに、 で注釈が付けられたメソッドが着信リクエストごとに呼び出されることに気付きました。

@InitBinder("categories")
public void bindFields(WebDataBinder binder) {
    binder.registerCustomEditor(Set.class, new CustomPropertyEditor());
}

@InitBinderメソッドでは、 a をバインダーに設定してPropertyEditorいます。なぜこれらのメソッドを何度も呼び出して同じものを設定する必要があるのか​​ わかりません。Spring はリクエストごと
に新しいオブジェクトを作成しますか?WebDataBinder

4

2 に答える 2