你在页面上用一样的元素名称txtscore吧。
String[] aScore  = request.getParameterValues("txtscore");score+i=request.getParameter("txtscore"+i).trim();
这肯定是错误的。

解决方案 »

  1.   

    废话,有你这么加的么?用数组啊!
    其实也很简单:String[] temp;
    for(i=1;i<=31;i++)
    {
      temp[i] =request.getParameter("txtscore"+i).trim();
    }
      

  2.   

    我在上一页面用的是"txtscore"+i,用一个循环定义的,通过检测,没有问题,也就是说request.getParameter("txtscore"+i).trim()在for循环中没有问题,关键就是得到相应的值之后怎么通过循环赋给score1,score2,score3......请赐教,小弟万分感谢!!!!
      

  3.   


    String[] temp="";
    for(i=1;i<=31;i++)
    {
      temp[i] =request.getParameter("txtscore"+i).trim();
    }
    有这么一个错误:
    xiugai.jsp:28: Error: The type of the left-hand side in this assignment, "java/lang/String[]", is not compatible with the type of the right-hand side expression, "java/lang/String".

    String[] temp="";
    改为:
    String[] temp=null;
    报错为:
    null
    java.lang.NullPointerException
    不给它赋个初值吧,更不行!
    我该怎么改啊!
      

  4.   

    我知道了怎么改了,把String[] temp;改为String temp[]=new String[32];即可。谢谢 nevergrief(孤独骑士) !