2011-08-02 3 views
0

<spring:bind> 태그를 얻으려고합니다. String 값을 인쇄하려고합니다. 내가 다른 콩 "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

당신은 대신 바인드 태그의 스핑 입력 태그를 사용할 수 있습니다

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

또한 콩을 확인하려면 원하는 값을 출력 가치가있을 수도 있습니다 제대로 채워졌습니다

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

감사합니다 객체 ..이 시도해보십시오 :) – t0mcat