Filling and submitting forms with Spring MVC and JSP

0

I'm starting Java Web , developing a stocking system following the Caelum Java applet for Web.

All front-end and the persistence layer have already been developed with only the control integrating the two, but I have a lot of doubts when it comes to getting the page data to treat them, insert in the database and so on. ..

For example in the page below, I have the Submission Form, according to what the booklet teaches I have to keep the fields named according to the corresponding attributes of the Class Shipping, until then quiet, the problem is that inside of the form I have a sub form that corresponds to class ItemEnvio and a table, where I can insert multiple items.

My goal is to fill a ArrayList with the items added in this table and the data from the top of the form in a Send object, send the two to controller and add it to the database, it's the logic that I use when I develop in Java using Swing with JTable and etc ..

Can anyone give an orientation on how to proceed?

    
asked by anonymous 07.03.2017 / 17:53

1 answer

0

During this week of research I found and already implemented the solution. 1 The completion and deletion of lines is done by JavaScript following the solution proposed by the user devgaspa from here in that forum Get the value of javaScript table and put in an array
In the send function, I have filled a JSON object with all the information in the form, and even an array with the data in the table. This JSON corresponds to the Envio class that has a ArrayList of Class ItemEnvio within it. I sent this JSON to the controller via AJAX request following the solution of this topic link .
Since all the manipulation was done in pure JS, when trying to use AJAX in JQuery, as the solution shows, it gave error, so I made AJAX requests in pure JavaScript by following this other topic link

    
14.03.2017 / 13:15