问一个关于struts的问题
今天用struts写了一个程序。为什么我在提交表单的时候,actionForm中获取到的表单值都为空呢
这个是我的部分
这个是struts中form-bean的配置代码
<form-bean name="teacher_PhoneForm" type="all_Forms.Teacher_PhoneForm"/>
这个是jsp页面中相关form的代码
<form action="/Student_Manager/Teacher/Strust/T_Man_Info/man_Info_phone.do"
method="post">
<input type="hidden" name="teacher_id" value=<%=t_id%> />
<tr>
<td>电话:</td>
<td><input type="text" name="teacher_phone"
value=<%=t_phone%> onfocus="this.value = '';"
onblur="if (this.value == '') {this.value = <%=t_phone%>;}"></input>
</td>
<td><input type="submit" onclick="myFunction()" value="提交">
</td>
</tr>
</form>
这个就是form获取结果的代码。打印出来全是null
Teacher_PhoneForm teacher_PhoneForm = (Teacher_PhoneForm) form;
String ww=teacher_PhoneForm.getTeacher_Phone();
System.out.println(ww);
String www=teacher_PhoneForm.getTeacher_ID();
System.out.println(www);