---
title: "SimpleFormController绑定实体问题"
author: "superfofo"
date: "2010-06-20T00:57:41Z"
tags: []
categories: ["企业架构"]
slug: "simpleformcontroller"
draft: false
lastmod: "2010-06-20T01:00:16Z"
id: 694835
url: "https://superfofo.iteye.com/blog/694835"
---

java.lang.IllegalStateException: Neither BindingResult nor plain target
object for bean name 'studentQuestion' available as request attribute


今天使用很久都没有使用的spring SimpleFormController，谁知道出问题了，如上所述的错误。
上网找了些资料，大概意思是需要去绑定表单上的实体，这些资料已经有很多讲解，以及理论也应该是这样的。
但我的问题跟他没有关系
先看我的表单：

```java

<table width="950" border="0" cellspacing="0" cellpadding="0" align="center" class="conListT">
  <tr>
    <td width="745">
```

<span style="color:red"><form:form action="/test/edittest.do" name="form1" method="post"></span>

```java

  <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>

```

<span style="color:red"></form:form></span>

```java

</td>
  </tr>
</table>

```


这是修改后的，红色字体的是关键，加上去之后，刷新页面居然好了。暂时还没有想明白为什么会这样。先备份吧！
原来的脚本<form action="/test/edittest.do" name="form1" method="post">