Blaze Blaze - 1 year ago 310
Java Question

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

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

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


where is my wrong?

Answer Source

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">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download