PDA

View Full Version : Question regarding forum construction


ccin123
Jun 5th, 2008, 12:28 PM
Hello,

I'm making this form submission page to input data, and along the way I'll make an update page which will allow users to update the data they submitted originally.

These two forms have same UI, except the input form wouldn't have any fields filled out but the update would have fields filled out from the info in the database.

In this situation, do I need to create two separate view pages and controllers for input action and update action?

Or is there a good design approach that I could use to only use one action and one view.

If anyone could provide a hand, that'd be great

Thanks,

Steve O
Jun 5th, 2008, 03:05 PM
You should take a look at the petclinic sample that ships with Spring.

The AddPetForm and the EditPetForm are good examples. They share the same petForm which can easily check to see if you are dealing with a new or an update and pass to the appropriate controller.

Good luck,

Steve O