0

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?

Blaze
  • 2,269
  • 11
  • 40
  • 82

1 Answers1

1

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">
Community
  • 1
  • 1
cralfaro
  • 5,822
  • 3
  • 20
  • 30