PDA

View Full Version : Which method should i override (SimpleFormController)


pers
Nov 9th, 2007, 09:16 AM
Hello
I'm new to the Spring MVC, but i've managed to come quite far in my workflow.

Now i'm facing a problem which i don't see the sollution for.

I have created a controller and view for a customer search which shows the list of customers that matches the search criteria.

What i want now is to have an edit link in the jsp for each customer

like /editCustomer?customerId=123

The editCustomerController should find the right customer and make a ModelAndView before presenting the form view containing all the relevant data.

What is the best method to override to manage this?
Are there any pitfals i need to be aware of when overriding this method?

Thankful for any help i can get

-- Per

TerpInMD
Nov 9th, 2007, 09:19 AM
If you want to retrieve the item from the dB and present in in edit mode then look at FormBackingObject. Once you make changes to the item then want to save them look at onSubmit.

infinity2heaven
Nov 9th, 2007, 12:37 PM
Have a look at this post (http://forum.springframework.org/showthread.php?t=45931), it talks about a use case with create/edit workflows

Jörg Heinicke
Nov 10th, 2007, 10:23 PM
Have a look at this one (http://longgoldenears.blogspot.com/2007/07/simpleformcontroller-workflow-lifecycle.html).

Joerg