title: Invalid property 'username' of bean class [java.util.ArrayList]: Bean property 'username' is not readable or has an invalid getter method
body: <p>I am getting this error "Invalid property 'username' of bean class [java.util.ArrayList]: Bean property 'username' is not readable or has an invalid getter method".</p>
  
  <p>I have the correct form bean with the name username though, but still i am getting this error, could you please help me to resolve this error..?</p>
  
  <pre><code>public class User {
  
      private int userId;
      private String username;
      private String firstname;
      private String lastname;
      private String email;
      private String lastUpdatedBy;
      private String lastUpdatedDate;
  
  
      public int getUserId() {
          return userId;
      }
      public void setUserId(int userId) {
          this.userId = userId;
      }
      public String getUsername() {
          return username;
      }
      public void setUsername(String username) {
          this.username = username;
      }
      public String getFirstname() {
          return firstname;
      }
      public void setFirstname(String firstname) {
          this.firstname = firstname;
      }
      public String getLastname() {
          return lastname;
      }
      public void setLastname(String lastname) {
          this.lastname = lastname;
      }
      public String getEmail() {
          return email;
      }
      public void setEmail(String email) {
          this.email = email;
      }
      public String getLastUpdatedBy() {
          return lastUpdatedBy;
      }
      public void setLastUpdatedBy(String lastUpdatedBy) {
          this.lastUpdatedBy = lastUpdatedBy;
      }
      public String getLastUpdatedDate() {
          return lastUpdatedDate;
      }
      public void setLastUpdatedDate(String lastUpdatedDate) {
          this.lastUpdatedDate = lastUpdatedDate;
      }    
  
  }
  </code></pre>
  
  <p>And my jsp page is below</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;UTVA Application&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form:form modelAttribute="user" method="post" action="/findUser.html"&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;form:label path="username"&gt;User ID:&lt;/form:label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="username" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;form:label path="firstname"&gt;First Name&lt;/form:label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="firstname" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&lt;form:label path="lastname"&gt;Last Name:&lt;/form:label&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="lastname" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td colspan="2"&gt;&lt;input type="submit" value="findUser" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/form:form&gt;    
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;User Id&lt;/td&gt;
                  &lt;td&gt;First Name&lt;/td&gt;
                  &lt;td&gt;Last Name&lt;/td&gt;
                  &lt;td&gt;Email Address&lt;/td&gt;
                  &lt;td&gt;Last Update Date&lt;/td&gt;
                  &lt;td&gt;Last Update By&lt;/td&gt;
              &lt;/tr&gt;
          &lt;c:forEach var="list" items="${userList}"&gt;
              &lt;tr&gt;
                  &lt;td&gt;${list.userId}&lt;/td&gt;
                  &lt;td&gt;${list.username}&lt;/td&gt;
                  &lt;td&gt;${list.firstname}&lt;/td&gt;
                  &lt;td&gt;${list.lastname}&lt;/td&gt;
                  &lt;td&gt;${list.email}&lt;/td&gt;
                  &lt;td&gt;${list.lastUpdatedBy}&lt;/td&gt;
                  &lt;td&gt;${list.lastUpdatedDate}&lt;/td&gt;    
                  &lt;td&gt;&lt;a href="listVendors.html?userId=${list.userId}"&gt;assignVendor&lt;/a&gt;&lt;/td&gt;          
              &lt;/tr&gt;
          &lt;/c:forEach&gt;
      &lt;/table&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and my controller is provided below</p>
  
  <pre><code>@Controller
  @SessionAttributes
  public class UserController {
  
      protected Log logger = LogFactory.getLog(getClass());
  
      @Autowired
      UserService userService;
  
      @RequestMapping(value="/userList")
      public ModelAndView getUserList(){
  
          List&lt;User&gt; userList = userService.getUserList();        
  
          return new ModelAndView("userList", "user", userList);      
      }
  
      @RequestMapping(value="/findUser")
      public ModelAndView findUser(@ModelAttribute("user") User user,
                                   BindingResult result){ 
  
          List&lt;User&gt; userResultsList = null;
  
          //model.addAttribute("user", new User());
  
          userResultsList = userService.findUser(user.getUsername(), user.getFirstname(),
                  user.getLastname());            
  
          return new ModelAndView("userList", "user", userResultsList);       
  
      }
  
  
  }
  </code></pre>