简体   繁体   中英

Bean property 'xxxx is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter

Why am I getting this error even when everything seems fine

this is the code in my index.jsp code

<body>
        <center><h1>SERVICE</h1>
            <h2>Enter Service Details</h2>
        <form:form method="POST" commandName="servDetForm" action="AddService">
              <table style="appearance:dialog ">

                    <tr>
                        <td>Number</td>
                        <td><form:input path="xxx"/></td>
                    </tr>
                    <tr>
                        <td>Number</td>
                        <td><form:input path="xxx"/></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td><form:button name="addService" value="Add Service">Add Service</form:button></td>

                    </tr>
                </table>
           </form:form>
            </center>
      </body>

where is my wrong?

You are sending a wrong instance to the view.

@RequestMapping(value="/index", method=RequestMethod.GET)
public ModelAndView indexView(){
    return new ModelAndView("index","servDetForm",new ServiceTb());
}

Also in your Bean need to use camelCase notation not snakecase. camelcase vs snakecase the explanation

Should be ItasTb entity

Change your JSP to:

<form:form method="POST" modelAttribute="servDetForm">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

Related Question Bean property 'cmpcode' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? Bean property 'xxx' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? Spring MVC: Bean property is not readable or has an invalid getter method Does the return type of the getter match the parameter type of the setter Bean property is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter? Spring Batch Bean property 'trustStore' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? Bean property 'sakilaDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? Invalid property 'id' of bean class: Bean property 'id' is not readable or has an invalid getter method: Does the return type of the getter match Using @ManyToOne value in Thymeleaf template - property '' is not readable or has an invalid getter method Does the return type of the getter Bean property is not readable or has an invalid getter method Does the parameter type of the setter match the return type of the getter?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM