harxa / bookstore

0 stars 0 forks source link

Chapter3, exercise4: Edit bookstore problem #2

Open harxa opened 5 years ago

harxa commented 5 years ago

Save after editing causese error: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Long'; nested exception is java.lang.NumberFormatException: For input string: "editBook"

Related to book id handling.

juhahinkula commented 5 years ago

You th:action is wrong in the Editbook page. It should be '../save' wiht two dots. Check the discussion forum. There is discussion about that.

Note! You also have to add book's id to the edit page (it can be hidden field) otherwise it creates new page instead of updating the existing one.

You also have to add missing fields (price and category) to the page same way than in add form. Otherwise listpage gives an error if category is null.