servlet怎样讲ajax传进来的数组提取出来

2025-04-16 16:42:33
推荐回答(1个)
回答1:

用ajax$post$get其实简写ajax给段代码 $.ajax({     type:"post",//请求式     url:"myServlet",//发送请求址     data:{//发送给servlet数据     name:["1","2"]     },     success:function(data,textStatus){//请求功调函数      $("#divs #upInfo").html(data);     }     }); web.xml配置文件servlet映射url配置:/myServlet 用$get或$post候用写type参数行 servlet面用ruquest.getParameterValues("name")获取数