I pass array of items from JS to spring controller. I have this model in JS:
function Row() {
this.id = 0;
this.rulingValue = '';
this.rulingType = '';
this.dateStart = '';
this.dateEnd = '';
}
I have array of Rows - var jsonData = [];
Then I fill this array. And set to
var oMyForm = new FormData();
oMyForm.append("items", jsonData);
In Spring controller I expect this array like List<Item>
@Data
public class Item {
private String id;
private String rulingValue;
private String rulingType;
private String dateStart;
private String dateEnd;
}
@RequestParam("items") List<Item> items
But my items parameter arrive as String. How can I get this array like List<Item>
?