Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to pass a list of data to backend?  RSS feed

sebastian edwin
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

To passing a list of data (array, arraylist etc) from backend to frontend is simple. But another way round, How to pass a list of data from frontend to backend?

I tried

var arr = [
{name: 'firstname', value: 'Hello'},
{name: 'lastname', value: 'World'}

var assignToIdSelectedArr = new Array();

var obj = {
status : "weldMachineModel"
var obj2 = [1,2,3];

type : 'POST',
url : "<s:url action="manageMaterial_test"/>",
dataType : 'json',
cache: false,
data: {
test : "test"
, mapExt : arr
success : function(data) {
error : function(XMLHttpRequest, textStatus, errorThrown) {
alert("Server connection error.");

In backend,
private String test;
private String[] testArr;
private List<String> testList = new ArrayList<String>();
private List<Material> materials = new ArrayList<Material>();
private List<Material> materialNOTs;

private Map map = new HashMap();
private Map<String, String> mapExt = new HashMap<String, String>();

But none of them can map to backend list / map, anyone can suggest me how to do that instead of using separator for long string?
sorry for bad english..

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!