これが私のコードです:
public ModelAndView login(@ModelAttribute("testVO") TestVO testVO){
//test the VO work theory
//testVO = new TestVO();
testVO.setTestStr("this is my test!");
return "index/index";
}
new を使用して testVO のオブジェクトを作成したとき。jsp ページで値を取得できません。set メソッドを使用した場合は機能します。
つまり、オブジェクト testVo は IOC コンテナーによって作成されているため、JSP は、自分で作成したものではなく、コンテナーから参照を取得します。
私は正しいですか?ありがとうございます。