Announcement Announcement Module
No announcement yet.
Error While Binding <form:input text to a list of object in form bean Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error While Binding <form:input text to a list of object in form bean


    I am new to spring frame work and i am trying to bind an<form:input with an list of objects in form
    I am getting an below error

    org.springframework.beans.NotReadablePropertyExcep tion: Invalid property 'sourceLocation0' of bean class [form]: Bean property 'sourceLocation0' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

    Following is my jsp Code

    <form:form method="POST" action="saveLocation.html" commandName="form">
    <c:forEach items="${form.sourceLocation}" var="location" varStatus="status">
    <form:input path="sourceLocation[${status.index}].selectedLocation}"/>

    Following is my form Object

    public class form {

    private List<Location> sourceLocation;

    public List<Location> getSourceLocation() {
    return sourceLocation;
    public void setSourceLocation(List<Location> sourceLocation) {
    this.sourceLocation = sourceLocation;
    public List<Location> getDestinationLocation() {
    return destinationLocation;
    public void setDestinationLocation(List<Location> destinationLocation) {
    this.destinationLocation = destinationLocation;

    following is my location object

    public class Location {
    private String selectedLocation;
    public Location() {
    public Location(String selectedLocation) {
    this.selectedLocation = selectedLocation;
    public String getSelectedLocation() {
    return selectedLocation;
    public void setSelectedLocation(String selectedLocation) {
    this.selectedLocation = selectedLocation;
    public String toString() {
    return selectedLocation;


    Can you please suggest