5 Replies Latest reply on Feb 16, 2006 3:06 PM by chris griffith

    Can not use Generics in JSP

    Daniel Woo Newbie

      Hi,

      I can not use generics in JSP, for example:

      <%
       List<User> list = new ArrayList<User>(1000);
       for (int i = 0; i < 1000; i++) {
       User u = new User("test" + i, i);
       list.add(u);
       }
       test.insertAllUserList(list);
       %>

      The console shows strace:

      11:53:16,546 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
      org.apache.jasper.JasperException: Unable to compile class for JSP
      An error occurred at line: 4 in the jsp file: /test_slsb_entity_insert.jsp
      Generated servlet error:
      Syntax error on token "<", invalid AssignmentOperator
      An error occurred at line: 4 in the jsp file: /test_slsb_entity_insert.jsp
      Generated servlet error:
      Syntax error on token "=", != expected
      An error occurred at line: 4 in the jsp file: /test_slsb_entity_insert.jsp
      Generated servlet error:
      Syntax error on token "new", delete this token