title: javax.el.PropertyNotFoundException: Property 'UserName' not found
body: <p>I have written a program to display some details entered in one form in another.Like I have a UserRegisteration.jsp where I am entering few details and UserAccount.jsp which has to display some of the entered details.I have created a model object UserDetails which has all the details of a particular code.
  When I am running the project I am getting the propertynotfound exception.I have checked everything and couldn't find the reason behind it.I have the getters and setters methods in my model class.And using auto-binding feature using @modelattribute.Kindly let me know if I missed any code.</p>
  
  <p>UserDetails.java</p>
  
  <pre><code>package com.bindu.myBankcontroller;
  import java.util.ArrayList;
  
  public class UserDetails {
  
  private String UserName;
  private String FirstName;
  private String LastName;
  
  private String EmailId;
  private ArrayList&lt;String&gt; AccountType;
  private ArrayList&lt;String&gt; gender;
  private Long AccountNo;
  private int age;
  private String password;
  
  Address address;
  
  public String getUserName() {
      return UserName;
  }
  
  public void setUserName(String userName) {
      UserName = userName;
  }
  
  public String getFirstName() {
      return FirstName;
  }
  
  public void setFirstName(String firstName) {
      FirstName = firstName;
  }
  
  public String getLastName() {
      return LastName;
  }
  
  public void setLastName(String lastName) {
      LastName = lastName;
  }
  
  
  public String getEmailId() {
      return EmailId;
  }
  
  public void setEmailId(String emailId) {
      EmailId = emailId;
  }
  
  public ArrayList&lt;String&gt; getAccountType() {
      return AccountType;
  }
  
  public void setAccountType(ArrayList&lt;String&gt; accountType) {
      AccountType = accountType;
  }
  
  public ArrayList&lt;String&gt; getGender() {
      return gender;
  }
  
  public void setGender(ArrayList&lt;String&gt; gender) {
      this.gender = gender;
  }
  
  public Long getAccountNo() {
      return AccountNo;
  }
  
  public void setAccountNo(Long accountNo) {
      AccountNo = accountNo;
  }
  
  public int getAge() {
      return age;
  }
  
  public void setAge(int age) {
      this.age = age;
  }
  
  public String getPassword() {
      return password;
  }
  
  public void setPassword(String password) {
      this.password = password;
  }
  
  public Address getAddress() {
      return address;
  }
  
  public void setAddress(Address address) {
      this.address = address;
  }
  
  
  
  }
  </code></pre>
  
  <p>Controller class,UserAccountController.java</p>
  
  <pre><code>package com.bindu.myBankcontroller;
  
  import org.springframework.ui.Model;
  import org.springframework.web.bind.annotation.ModelAttribute;
  import org.springframework.web.bind.annotation.*;
  import org.springframework.stereotype.*;
  import org.springframework.web.servlet.ModelAndView;
  import com.bindu.myBankcontroller.UserDetails;
  
  @Controller
  public class UserAccountController {
  
  @ModelAttribute
  public void addingCommonObjects(Model model1) {
  
      model1.addAttribute("headerMessage", "MyBank, India");
  }
  
  @RequestMapping(value="/LoginForm.html", method = RequestMethod.GET)
  public ModelAndView getAdmissionForm() {
  
      ModelAndView model1 = new ModelAndView("LoginForm");
  
      return model1;
  }
  
  @RequestMapping(value="/userRegistration.html", method = RequestMethod.GET)
  public ModelAndView submitRegistrationForm() {
  
      ModelAndView model1 = new ModelAndView("UserRegistration");
      return model1;
  }
  
  @RequestMapping(value="/UserAccount.html", method = RequestMethod.POST)
  public ModelAndView userAccountForm(@ModelAttribute("user") UserDetails user) {
  
      System.out.println("User name:"+user.getUserName());
      ModelAndView model1 = new ModelAndView("UserAccount");
      return model1;
  }
  
  
  }
  </code></pre>
  
  <p>UserAccount.jsp</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
      &lt;h1&gt;${headerMessage}&lt;/h1&gt;
  
      &lt;h3&gt;Congratulations!! you have successfully registered&lt;/h3&gt;
  
      &lt;h2&gt;Details submitted by you:: &lt;/h2&gt;
  
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;User Name :&lt;/td&gt;
              &lt;td&gt;${user.UserName}&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;First Name :&lt;/td&gt;
              &lt;td&gt;${user.FirstName}&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Last Name :&lt;/td&gt;
              &lt;td&gt;${user.LastName}&lt;/td&gt;
          &lt;/tr&gt;
  
      &lt;/table&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>None of the related posts helped me in resolving this issue, so I have posted this one.</p>