Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda