SimpleFormController绑定实体问题
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'studentQuestion' available as request attribute
今天使用很久都没有使用的spring SimpleFormController,谁知道出问题了,如上所述的错误。 上网找了些资料,大概意思是需要去绑定表单上的实体,这些资料已经有很多讲解,以及理论也应该是这样的。 但我的问题跟他没有关系 先看我的表单:
<table width="950" border="0" cellspacing="0" cellpadding="0" align="center" class="conListT">
<tr>
<td width="745">
<form:form action="/test/edittest.do" name="form1" method="post">
<table>
<tr>
<td>提问:</td>
<td>
<form:textarea path="studentQuestion" rows="3" cols="60"/>
</td>
</tr>
<tr>
<td colspan=2 align="center"><INPUT type="submit" value="完成" name="_finish"/></td>
</tr>
</table>
</form:form>
</td>
</tr>
</table>
这是修改后的,红色字体的是关键,加上去之后,刷新页面居然好了。暂时还没有想明白为什么会这样。先备份吧! 原来的脚本