JSP里想用split函数把字符串转化成数组,但显示java.lang.NumberFormatException: For input string: "[21"

main.jsp

<%!public String ch(){
                int[] fixedArrays = new int[30];
        int[] resArrays = new int[10];
        int fLen = fixedArrays.length;
        int rLen = resArrays.length;
        //为指定数列fixedArrays赋以1-30的值
        for(int i = 0; i < fLen; i++) {
            fixedArrays[i] = i+1;
        }
        Random random = new Random();        
        //随机不重复,思路:被选中的数被放到最后一位,然后再次随机选取是将范围-1
        for(int i = 0; i < rLen;i++) {
            int index = random.nextInt(fLen-i);//随机生成指定数列的下标,并且范围在0-flen-i;
            resArrays[i] = fixedArrays[index];
            
            int temp = fixedArrays[index];
            fixedArrays[index] = fixedArrays[fLen-i-1];
            fixedArrays[fLen-i-1] = temp;
        }
                  return Arrays.toString(resArrays);
                }
           %>
           
           <%
              String resAttray = ch();
              session.setAttribute("res",resAttray);
               %>

search.jsp

<%
                                String ress = (session.getAttribute("res").toString());
                                out.print(ress);
                                String str[] = ress.split(",");
                                int arr[] = new int[str.length];
                                for(int i = 0;i < str.length;i++){
                                    arr[i] = Integer.parseInt(str[i]);
                                }
                                out.print(arr);
                               %>

[21,字符串中包含大括号,转换失败了,检查一下字符串。