title: java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'RegistrationBean' available as request attribute
body: <p>I am getting this exception :</p>
  
  <pre><code>    java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'RegistrationBean' available as request attribute
  </code></pre>
  
  <p>This is my controller class</p>
  
  <pre><code>@Controller
  public class TenantRegistrationController {
  
      @Autowired
      private TenantService tenantService;
  
      @Autowired
      private UserService userService;
  </code></pre>
  
  <p>RegistrationBean is the bean class which is passed from the jsp as model attribute.</p>
  
  <pre><code>    @RequestMapping(value="/registration", method= RequestMethod.POST)
      public String addNewTenant(@ModelAttribute("RegistrationBean")RegistrationBean registrationBean, 
              BindingResult result, Map&lt;String,Object&gt; map)
      {
          Tenant tenant = new Tenant();
  
          tenant.setTenant_name(registrationBean.getTenantName());
          tenant.setTenant_email(registrationBean.getTenantEmail());
          tenant.setAddress(registrationBean.getTenantAddress());
  //      tenant.setReminder_email(Integer.parseInt(registrationBean.getReminderMail()));
          tenant.setReminder_email(registrationBean.getReminderMail());
          tenant.setThankyou_email(registrationBean.getThankyouMail());
  
          CurrencyFormat cf = new CurrencyFormat();
          cf.setCurrencyFormatId(registrationBean.getCurrencyFormatId());
          tenant.setTenantCurrencyFormat(cf);
  
          DateFormat df = new DateFormat();
          df.setDateFormatId(registrationBean.getDateFormatId());
          tenant.setTenantDateFormat(df);
  
          tenant.setRegistration_date(registrationBean.createRegistrationDate());
  
          tenantService.addTenant(tenant);
  
  
          User user = new User();
          user.setName(registrationBean.getUserName());
          user.setAddress(registrationBean.getUserAddress());
          user.setUser_name(registrationBean.getUserLoginName());
          user.setDesignation(registrationBean.getUserDesignation());
          user.setPassword(registrationBean.getUserPassword());
          user.setEmail(registrationBean.getUserEmail());
          user.setContact_number(registrationBean.getUserContactNo());
  
          Role urole=new Role();
          urole.setRole_id(1);
          user.setUser_role(urole);
  
  
          userService.addUser(user);
  
          map.put("tenant_name", tenant.getTenant_name());
          return "tenant_registration_success";
  
      }
  
  
      @RequestMapping("/addANewTenant")
      public String showAddTenantPage(Map&lt;String, Object&gt; map)
      {
          /*map.put("item", new Item());
          map.put("itemList", itemService.listitems());*/
          return "add_tenant_details";
      }
  
  }
  </code></pre>
  
  <p>This is my JSP file</p>
  
  <pre><code>&lt;%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%&gt;
  
  &lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&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=ISO-8859-1"&gt;
  &lt;title&gt;Tanent Registration and Tanent Administrator Registration&lt;/title&gt;
  &lt;style&gt;
  .error {
  color: #ff0000;
  font-style: italic;
  }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  </code></pre>
  
  <p>I am specifying the bean named "RegistrationBean" as modelAttribute</p>
  
  <pre><code>&lt;h3&gt;Tenant Registration&lt;/h3&gt;
  &lt;form:form method="post" action="/MTInvoiceManagement/tenant/registration.html" modelAttribute="RegistrationBean"&gt;
  &lt;table align="left"&gt;
         &lt;tr&gt;
                &lt;td&gt;Tenant Name&lt;/td&gt;
                &lt;td&gt;&lt;form:input path="tenantName" type="text" /&gt;&lt;/td&gt;
                &lt;td&gt;&lt;form:errors path="tenantName" cssClass="error"&gt;&lt;/form:errors&gt;&lt;/td&gt;
         &lt;/tr&gt;
  
         &lt;tr&gt;
                &lt;td&gt;Tenant Email&lt;/td&gt;
                &lt;td&gt;&lt;form:input path="tenantEmail" type="text" /&gt;&lt;/td&gt;
                &lt;td&gt;&lt;form:errors path="tenantEmail" cssClass="error"/&gt;&lt;/td&gt;
  
         &lt;/tr&gt;
         &lt;tr&gt;
                &lt;td&gt;Tenant Address&lt;/td&gt;
                &lt;td&gt;&lt;input name="tenantAddress" type="text" /&gt;&lt;/td&gt;
                &lt;td&gt;&lt;form:errors path="tenantAddress" cssClass="error" &gt;&lt;/form:errors&gt;&lt;/td&gt;
         &lt;/tr&gt;
  
         &lt;tr&gt;
                &lt;td&gt;Reminder Mail&lt;/td&gt;
                &lt;td&gt;
                       &lt;form:select path="reminderMail"&gt;                     
                       &lt;form:option value="0" label="No"  /&gt;
                       &lt;form:option value="1" label="Yes" /&gt;
                       &lt;/form:select&gt;
                &lt;/td&gt;
                &lt;td&gt;&lt;form:errors path="reminderMail" cssClass="errors"&gt;&lt;/form:errors&gt;&lt;/td&gt;
         &lt;/tr&gt;
  
  
         &lt;tr&gt;
                &lt;td&gt;Thank You Mail&lt;/td&gt;
                &lt;td&gt;
                       &lt;form:select path="thankyouMail"&gt;
                       &lt;form:option value="0" label="No"&gt;&lt;/form:option&gt;
                       &lt;form:option value="1" label="Yes"&gt;&lt;/form:option&gt;
                       &lt;/form:select&gt;
                &lt;/td&gt;
                &lt;td&gt; &lt;form:errors path="thankyouMail" cssClass="errors"&gt;&lt;/form:errors&gt;  &lt;/td&gt;
         &lt;/tr&gt;
  
         &lt;tr&gt;
                &lt;td&gt;Date Format&lt;/td&gt;
                &lt;td&gt;
                       &lt;form:select path="dateFormatId"&gt;
                       &lt;form:option value="1" label="DD-MM-YY"&gt;&lt;/form:option&gt;
                       &lt;form:option value="2" label="MM-DD-YY"&gt;&lt;/form:option&gt;
                       &lt;form:option value="3" label="YYYY-MM-DD"&gt;&lt;/form:option&gt;
                       &lt;/form:select&gt;
                &lt;/td&gt;
                &lt;td&gt;&lt;form:errors path="dateFormatId" cssClass="errors"&gt;&lt;/form:errors&gt;&lt;/td&gt;
         &lt;/tr&gt;
  
         &lt;tr&gt;
                &lt;td&gt;Currency Format&lt;/td&gt;
                &lt;td&gt;
                       &lt;form:select path="currencyFormatId"&gt;
                       &lt;form:option value="1" label="$"&gt;&lt;/form:option&gt;
                       &lt;form:option value="2" label="£"&gt;&lt;/form:option&gt;
                       &lt;form:option value="3" label="¥"&gt;&lt;/form:option&gt;
                       &lt;form:option value="4" label="€"&gt;&lt;/form:option&gt;
                       &lt;form:option value="5" label="₨"&gt;&lt;/form:option&gt;
                       &lt;/form:select&gt;
                &lt;/td&gt;
                &lt;td&gt;&lt;form:errors path="currencyFormatId" cssClass="errors" &gt;&lt;/form:errors&gt;&lt;/td&gt;
         &lt;/tr&gt;
  
         &lt;tr&gt;
              &lt;td&gt; &lt;h3&gt; Tanent Administrator Details  &lt;/h3&gt;  &lt;/td&gt;
         &lt;/tr&gt;
  
         &lt;tr&gt;
                &lt;td&gt;Tanent Admin Name&lt;/td&gt;
                &lt;td&gt;&lt;form:input path="userName" type="text"/&gt; &lt;/td&gt;
                &lt;td&gt; &lt;form:errors path ="userName" cssClass="errors"&gt;&lt;/form:errors&gt; &lt;/td&gt;
         &lt;/tr&gt;
  
         &lt;tr&gt;
                &lt;td&gt;Tanent Admin User Login Name&lt;/td&gt;              
                &lt;td&gt;&lt;form:input path="userLoginName" type="text"/&gt; &lt;/td&gt;
                &lt;td&gt; &lt;form:errors path ="userLoginName" cssClass="errors"&gt;&lt;/form:errors&gt; &lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr&gt;
                &lt;td&gt;Tanent Admin User Password&lt;/td&gt;              
                &lt;td&gt;&lt;form:input path="userPassword" type="password"/&gt; &lt;/td&gt;
                &lt;td&gt; &lt;form:errors path ="userPassword" cssClass="errors"&gt;&lt;/form:errors&gt; &lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr&gt;
                &lt;td&gt;Tanent Admin User Email&lt;/td&gt;              
                &lt;td&gt;&lt;form:input path="userEmail" type="text"/&gt; &lt;/td&gt;
                &lt;td&gt; &lt;form:errors path ="userEmail" cssClass="errors"&gt;&lt;/form:errors&gt; &lt;/td&gt;
         &lt;/tr&gt;
         &lt;tr&gt;
                &lt;td&gt;Tanent Admin User Contact No&lt;/td&gt;              
                &lt;td&gt;&lt;form:input path="userContactNo" type="text"/&gt; &lt;/td&gt;
                &lt;td&gt; &lt;form:errors path ="userContactNo" cssClass="errors"&gt;&lt;/form:errors&gt; &lt;/td&gt;
         &lt;/tr&gt;
                &lt;tr&gt;
                &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                &lt;td&gt;
                       &lt;input name="Submit" type="submit" value="submit" /&gt;
  
                &lt;/td&gt;
         &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form:form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please help me!!</p>