title: Arraylist not working in JSP scriptlet
body: <p>When I am trying below code in Java 1.6/1.7 with Jboss 4.0 I am getting below exceptions. I don't have option here to use jstl.</p>
  
  <pre><code>Servlet.service() for servlet jsp threw exception
  org.apache.jasper.JasperException: Unable to compile class for JSP
  
  An error occurred at line: 13 in the jsp file: /sample.jsp
  Generated servlet error:
  Syntax error on token "&lt;", invalid AssignmentOperator
  
  An error occurred at line: 13 in the jsp file: /sample.jsp
  Generated servlet error:
  Syntax error on token "=", != expected
  
  An error occurred at line: 13 in the jsp file: /sample.jsp
  Generated servlet error:
  Syntax error on token "&lt;", ( expected
  
  An error occurred at line: 13 in the jsp file: /sample.jsp
  Generated servlet error:
  Syntax error on token "(", invalid Expression           
      at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
      at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
      at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
  </code></pre>
  
  <p><strong>My Jsp file is below :</strong></p>
  
  <pre><code>    &lt;%@ page import="java.util.*" %&gt;  
  
      &lt;% ArrayList&lt;String&gt; list=new ArrayList&lt;String&gt;();  
         list.add("Hello");  
      %&gt;  
  
      &lt;%= list.get(0) %&gt;
  </code></pre>