这句什么意思!怎么来说这句!

String[] location_id =request.getParameterValues("location_id")[0].toString().split(",");
这句怎么解释!请说清楚!

从request域中取出数组中的第1个值,转换成字符串格式,并用逗号分隔开

建议你一步一步去掉输出一下就知道了

request.getParameterValues("location_id") 从请求中得到name是"location_id"的数据,返回值是字符串数组 [0] 得到字符串数组的下标为0的元素,也就是第一个元素
.toString()[转成字符串(感觉这步多余了,本身就是字符串了)].split(",")[在0下标的这个字符串中以","号为标记,进行切割,得到字符串数组]

从request中取出参数location_id的第一个值,转换成string后按照“,”分隔开成string数组

你这个代码明显有漏洞 如果request得到一个null,还可以toString吗

String[] location_id =request.getParameterValues("location_id")[0].toString().split(",");
等价于
Object[] obj = request.getParameterValues("location_id"); //取数组
String temp = obj[0].toString(); //获取数组第1个元素并用toString()转换为字符串
String[] location_id = temp.split(","); //通过逗号,分隔字符串,得到 数组 location_id