Passing javascript array to servlet

后端 未结 3 1398
清酒与你
清酒与你 2021-01-02 09:04

I have looked previous questions on this topic on SO, but my problem is not solved yet.

I am passing the array from javascript to servlet.

JavaScript Code:

3条回答
  •  囚心锁ツ
    2021-01-02 09:25

    You can't pass a java array as a parameter, as it is an structure. The best way is to serialize it into an string object like a jSon. You can use JSON.stringify. Simple and efficient. As you can serialize in the server also, it's very useful.

提交回复
热议问题