title: Spring MVC 3: java.lang.IllegalStateException
body: <p>Hi
  Could someone help me understand what am I doing wrong in the following code due to which I am getting this error: </p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'user' available as request attribute
      at org.springframework.web.servlet.support.BindStatus.&lt;init&gt;(BindStatus.java:141)
      at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:174)
      at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(AbstractDataBoundFormElementTag.java:194)
      at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getName(AbstractDataBoundFormElementTag.java:160)
      at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.autogenerateId(AbstractDataBoundFormElementTag.java:147)
      at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.resolveId(AbstractDataBoundFormElementTag.java:138)
      at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.writeDefaultAttributes(AbstractDataBoundFormElementTag.java:122)
      at org.springframework.web.servlet.tags.form.AbstractHtmlElementTag.writeDefaultAttributes(AbstractHtmlElementTag.java:408)
      at org.springframework.web.servlet.tags.form.InputTag.writeTagContent(InputTag.java:140)
      at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:102)
      at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)
      at org.apache.jsp.WEB_002dINF.views.signUp_jsp._jspx_meth_form_005finput_005f0(signUp_jsp.java:179)
      at org.apache.jsp.WEB_002dINF.views.signUp_jsp._jspx_meth_form_005fform_005f0(signUp_jsp.java:111)
      at org.apache.jsp.WEB_002dINF.views.signUp_jsp._jspService(signUp_jsp.java:74)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
      ... 59 more
  </code></pre>
  
  <p><strong>UserManagementController.java</strong></p>
  
  <pre><code>@Controller
  public class UserManagementController { 
      //displays sign up page(GET)
      @RequestMapping(method=RequestMethod.GET, value="/signUp.html")
      public ModelAndView signUpForm() {
          System.out.println("Sign up");
          return new ModelAndView("/signUp", "user", new User());
      }
  
  }
  </code></pre>
  
  <p><strong>signUp.jsp</strong></p>
  
  <pre><code>&lt;body&gt;
      &lt;h3&gt;Sign up&lt;/h3&gt;
      &lt;table&gt;
          &lt;form:form commandName="user" &gt;
              &lt;tr&gt;
                  &lt;td&gt;First name:&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="firstName"/&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Last name:&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="lastName"/&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Username:&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="username"/&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Password:&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="password"/&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Email:&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="email"/&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input type="submit" value="Submit"&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/form:form&gt;
      &lt;/table&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Could someone help me understand it?</p>
  
  <p>Thanks.</p>