2011-08-02 16 views
0

<spring:bind>タグを取得しようとしています。私は文字列値を印刷しようとしています。私は別のBean "presentStudent" から "MyBeanと" 取得
スプリングMVCスプリング:バインドタグ

mySimpleBean myBean = presentStudent.getSubjects().getTeacherName(); 
    String firstName = myBean.getTeacherFirstName() 

:コードは次のように見えます。 jspで私は試しています:

<spring:bind path="presentStudent.subjects.teacherName.teacherFirstName"> 
    <input type="text" name="${status.expression}" value="${status.value}"> 

しかし、それは何も印刷されません。 また、「presentStudentは」このフォームにcommandObjectです:

<form:form id="stuTeachForm" name="stuTeachForm" method="post" commandName="presentStudent" 
    action="getStuTeachData.html"> 

答えて

0

あなたはSPING入力タグを使用することができる代わりのバインドタグ

<form:form id="stuTeachForm" name="stuTeachForm" method="post" commandName="presentStudent" action="getStuTeachData.html"> 
    <form:input type="text" path="subjects.teacherName.teacherFirstName"/> 

はまたあなたのBeanをチェックするために必要な値を出力する価値があるかもしれません正しく設定されています

First name is ${presentStudent.subjects.teacherName.teacherFirstName} 
+0

ありがとうございます。 – t0mcat

関連する問題