6nagi9
6nagi9

Reputation: 544

Save form data on GET requests in Spring MVC

I have this huge spring form containing a table where the user can add or delete rows of data. It is basically a GridView. For deleting I have put anchors which do the job through GET requests. The problem I am facing is that after a user has added one or more rows of data to the table, which are still in editable (textarea) mode, if he wants to delete some other row, the text that he has painstakingly written on those textareas dissappear, they do not get bound the form bean and they do not travel with the GET requests. I know not of an elegant solution to tackle the problem, except, ofcourse that I can submit the form periodically through Javascript. Is there a better design solution out there? Please share?

Upvotes: 0

Views: 238

Answers (1)

NimChimpsky
NimChimpsky

Reputation: 47290

For deleting I have put anchors which do the job through GET requests.

A bad idea. Actually a very bad idea, a web crawler bot could delete rows accidently.

With a post request you simply have to ensure the name of the client side added element is congruent (I assume it is a collection on a backing bean) with the existing spring form.

Upvotes: 2

Related Questions