Java 为什么传递数组时会发生这种情况?

Java 为什么传递数组时会发生这种情况?,java,javascript,arrays,jsp,Java,Javascript,Arrays,Jsp,我试图使用document.formname.action将值数组从.js文件中的函数传递到.jsp文件,但它创建数组索引时超出了范围 我的.js文件(注意这一行:document.detailsview.action=”“): 控制台中的输出为: IN AVAILABLE:Size of KOT array is :19 IN AVAILABLE:Size of ITEM array is:19 IN AVAILABLE:size of STATUS array is:1 如果是异常,请粘贴

我试图使用
document.formname.action
将值数组从
.js
文件中的函数传递到
.jsp
文件,但它创建数组索引时超出了范围

我的
.js
文件(注意这一行:
document.detailsview.action=”“
):

控制台中的输出为:

IN AVAILABLE:Size of KOT array is :19
IN AVAILABLE:Size of ITEM array is:19
IN AVAILABLE:size of STATUS array is:1

如果是异常,请粘贴stacktrace。没有错误。但是状态数组的大小是1。这就是问题所在。您能否通过stacktrace,从中得出结论,您得到了一个数组ondex越界异常?它显示在Myerrorhandler.jsp中
case 11:
gotMethod = true;   
billdetails_be.billno = Integer.valueOf(request.getParameter("billno"));
String[] kotCbb=request.getParameterValues("kot");
String[] itemCbb=request.getParameterValues("itemcode");
String[] statCbb=request.getParameterValues("itemStatus1");
System.out.println("IN AVAILABLE:Size of KOT array is :" +kotCbb.length);
System.out.println("IN AVAILABLE:Size of ITEM array is:"+itemCbb.length);
System.out.println("IN AVAILABLE:size of STATUS array is:"+statCbb.length);
IN AVAILABLE:Size of KOT array is :19
IN AVAILABLE:Size of ITEM array is:19
IN AVAILABLE:size of STATUS array is:1