转载地址:http://blog.sina.com.cn/s/blog_611f65fd0100msc6.html。

1.Action 中代码 

             List result = new ArrayList();   

             result.add("abc");   

             result.add("dfb");   

             request.setAttribute("result", result);  

2.JSP 中代码

 

        <script language=javascript>          

             var arrList = new Array();   

             arrList = "${result}".replace('[','').replace(']','').split(',');   

             alert(arrList);   

             // 输出 abc,bcd   

        </script>  

相关文章:

  • 2021-09-10
  • 2021-12-06
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2021-11-19
  • 2021-05-29
猜你喜欢
  • 2021-11-23
  • 2022-12-23
  • 2021-12-26
  • 2021-09-13
  • 2021-11-13
  • 2022-12-23
相关资源
相似解决方案