Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Edit Data

 
Arian Zand
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

As some already know I creating Crud app
I already have Read,Delete and create but I get an error while updating data

When I click on a reservation(for a hotel) I get the values from my reservation, in my form i can edit the value and I like to update it to the DB

My controller for my edit


In my Dao I only have one parameter the reservation ID (Is this right?)



In my DaoImpl I update my data
, I dont know which function to use to update data , I used refresh... / Also tried Merge


If i click on update i get this error:
SEVERE: Servlet.service() for servlet appServlet threw exception
java.lang.IllegalStateException: Handler parameter annotations are exclusive choices - do not specify more than one such annotation on the same parameter: public java.lang.String eu.test.test4.controller.ReservationController.reservationEditUpdate(java.lang.Integer,eu.test.test4.model.Reservation,org.springframework.validation.BindingResult,org.springframework.ui.ModelMap)


EDIT

I dont know why but I have "0" as reservationId in my Post Method controller
Is there something wrong with my modelattribute ?
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of Spring are you using? If you are using 3.1 the fix is a bit more flexible. See below link.

https://jira.springsource.org/browse/SPR-6801?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel#issue-tabs
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic