I tried to create arrayList method in JSP as the following :
    <%!
       public int x = 0;
       public ArrayList array = new ArrayList();
       array.add(new ArrayList());
       public ArrayList cidTime (int cid, int w)
       {
            ((ArrayList)array.get(x)).add(cid);
            ((ArrayList)array.get(x)).add(w);
            x++;
            return array;
       }
      %>
but it returned error :
                    Syntax error on token(s), misplaced construct(s) 
                    Syntax error on token "add", = expected after this token
any suggestion?
 
     
    