Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
Spring MVC AutoPopulatingList error

I'm creating a form with "add row" items and used AutoPopulatingList for spring. I started with the basic with just one row.

I have model:

ContractEntitlement.java

public class ContractEntitlement {

    private String category;

    getter and setter ....
}

I created a form class for the AutoPopulatingList:

CreateForm.java

@Entity
public class CreateForm {

    private AutoPopulatingList contractEntitlements;

    public AutoPopulatingList getContractEntitlements() {
        return contractEntitlements;
    }
    public void setContractEntitlements(AutoPopulatingList contractEntitlements) {
        this.contractEntitlements = contractEntitlements;
    }
}

For my controller:

CreateController.java

@RequestMapping(value = "/create", method = RequestMethod.GET)
public String createForm(Model model) {

    CreateForm createForm = new CreateForm();

//      CreateForm sbf = new CreateForm(); 
//      //sbf.getContractEntitlements().add(new ContractEntitlement());
//      sbf.setContractEntitlements(new 
//        AutoPopulatingList(ContractEntitlement.class)); 
    return "create";
}    

For my jsp

Create.jsp

    <spring:bind path="createForm.contractEntitlements[0].category">
                <form:input path="${status.expression}" size="40" />
    </spring:bind>

Notice in my controller I have commented out a few line of codes as I was testing to see which one works but all fails and I'm getting this error:

org.springframework.beans.NotReadablePropertyException: Invalid property 'contractEntitlement' of bean class [com.at.ccts.model.CreateForm]: Bean property 'contractEntitlement' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

If I use this in my controller

CreateForm sbf = new CreateForm(); 
    sbf.setContractEntitlements(new 
AutoPopulatingList(ContractEntitlement.class)); 

Error:

ERROR: org.springframework.web.servlet.tags.form.InputTag - Invalid property 'contractEntitlement' of bean class [com.at.ccts.model.CreateForm]: Bean property 'contractEntitlement' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

Am I missing something? Any ideas what causes the error?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!