How can we get JavaScript array by JSP scriptlet

前端 未结 2 1873
迷失自我
迷失自我 2021-01-22 03:08

I need JavaScript array/multidimensional which is returned by Java class,



        
2条回答
  •  星月不相逢
    2021-01-22 03:46

    your can use json lib, on http://json.org there are many json librarys, i.e.

    int[] arr = new int [] {1,2,3}; // java
    

    convert to:

    var arr = [1,2,3];  // javascript
    

提交回复
热议问题