随笔-9  评论-168  文章-266  trackbacks-0
JS:
ids:[4,5,6]

JSP:
//专用于传数单个字符串,返回值是字符串
String ids=request.getParameter("ids");    //["4"]
//专用于传数数组对象,返回值是字符串数组
String[] s=request.getParameterValues("ids");   //s:["4","5","6"]
//循环将字符串数组对象转换成数组
int[] a=new int[s.length];
for(int i=0;i<s.length;i++){
a[i]=Integer.parseInt(s[i]);      //a:[4,5,6]
}
posted on 2008-09-20 11:02 紫蝶∏飛揚↗ 阅读(1794) 评论(0)  编辑  收藏 所属分类: 数据转换

只有注册用户登录后才能发表评论。


网站导航: