title: Model attribute is not available as request attribute in JSP page
body: <p>I am trying to create a sample registration page with <strong>Spring MVC</strong> and JSP pages.</p>
  
  <p>While opening the url on tomcat server, I am getting following error</p>
  
  <pre><code>root cause
  java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'register' available as request attribute
  org.springframework.web.servlet.support.BindStatus.&lt;init&gt;(BindStatus.java:144)
  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:168)
  org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(
  </code></pre>
  
  <p>I have a JSP <strong>register.jsp</strong></p>
  
  <pre><code>    &lt;%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%&gt;
      &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
      &lt;html&gt;
      &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
      &lt;title&gt;Registration&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;form:form action="/register/process" method="POST" modelAttribute="register"&gt;
          &lt;table style="text-align: center;"&gt;
  
              &lt;tr&gt;
                  &lt;td&gt;&lt;form:label path="fname"&gt;First Name&lt;/form:label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="fname" name="fname"
                          id="fname" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;form:label path="lname"&gt;Last Name&lt;/form:label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="lname" name="lname" id="lname" /&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;/td&gt;
                  &lt;td&gt;
                  &lt;input type="submit" value="CREATE AN ACCOUNT"/&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/form:form&gt;
     &lt;/body&gt;
    &lt;/html&gt;
  </code></pre>
  
  <p>I have a controller class <strong>UserController.java</strong></p>
  
  <pre><code>package vnfhub.supplier.controller;
  
  @Controller
  public class UserController {
      @RequestMapping(value = "/register", method = RequestMethod.GET)
      public String getRegisterForm(Model model) {
          model.addAttribute("register", new Register());
          return "register";
      }
  
     @RequestMapping(value = "/register/process", method = RequestMethod.POST)
     public String processRegistration(@ModelAttribute("register") Register register, BindingResult result) {
         return "success";
     }
  }
  </code></pre>
  
  <p>and a <strong>success.jsp page</strong></p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;Success Form&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;font color="green"&gt;&lt;h1&gt;Hello&lt;/h1&gt;&lt;/font&gt;
  
  &lt;h1&gt;You have successfully registered&lt;/h1&gt;
  &lt;font color="green"&gt;&lt;h1&gt;Welcome to Spring world !&lt;/h1&gt;&lt;/font&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have tried many solution on stackoverflow.... but none of them worked.</p>