java.lang.ArrayIndexOutOfBoundsException: 2 5
typeExceptionreportmessagedescriptionTheserverencounteredaninternalerror()thatprevent...
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.ArrayIndexOutOfBoundsException: 2
com.operationServlet.orderOperation.doGet(orderOperation.java:64)
com.operationServlet.orderOperation.doPost(orderOperation.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.35 logs.
//通过request获得从页面上提交的信息
String fwsj=request.getParameter("stime");
String middle[]=fwsj.split("-");
fwsj=middle[0]+"/"+middle[1]+"/"+middle[2];
String shdd=request.getParameter("shdd");
String lxr=request.getParameter("lxr");
String lxdh=request.getParameter("tel");
String str=request.getParameter("proContent");
String total=request.getParameter("total");
//由于str中保存了产品编号,产品数量,产品价格,所以通过字符串方法进行处理
String proContent[]=str.split("\n");
int orderInfo[][]=new int[proContent.length][3];
float price[]=new float[proContent.length];
for(int i=0;i<proContent.length;i++){
String ss=proContent[i].trim();
String sr[]=ss.split(":");
for(int t=0;t<sr.length-1;t++){
orderInfo[i][t]=Integer.parseInt(sr[t]);
}
price[i]=Float.parseFloat(sr[2]);
} 展开
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.ArrayIndexOutOfBoundsException: 2
com.operationServlet.orderOperation.doGet(orderOperation.java:64)
com.operationServlet.orderOperation.doPost(orderOperation.java:99)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.35 logs.
//通过request获得从页面上提交的信息
String fwsj=request.getParameter("stime");
String middle[]=fwsj.split("-");
fwsj=middle[0]+"/"+middle[1]+"/"+middle[2];
String shdd=request.getParameter("shdd");
String lxr=request.getParameter("lxr");
String lxdh=request.getParameter("tel");
String str=request.getParameter("proContent");
String total=request.getParameter("total");
//由于str中保存了产品编号,产品数量,产品价格,所以通过字符串方法进行处理
String proContent[]=str.split("\n");
int orderInfo[][]=new int[proContent.length][3];
float price[]=new float[proContent.length];
for(int i=0;i<proContent.length;i++){
String ss=proContent[i].trim();
String sr[]=ss.split(":");
for(int t=0;t<sr.length-1;t++){
orderInfo[i][t]=Integer.parseInt(sr[t]);
}
price[i]=Float.parseFloat(sr[2]);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询