aspose file tools*
The moose likes Spring and the fly likes Edit Data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Edit Data" Watch "Edit Data" New topic
Author

Edit Data

Arian Zand
Greenhorn

Joined: May 28, 2012
Posts: 9
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

Joined: Mar 07, 2010
Posts: 1648
    
    7

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


[How To Ask Questions][Read before you PM me]
 
Consider Paul's rocket mass heater.
 
subject: Edit Data