A NullPointerException in the code
<p>When I am trying to execute the code below, in the project it gives an error <code>manual array copy to collection</code>. On the other hand, when I execute the project in the JSP using NetBeans, it is showing <code>NPE</code> at a <code>for-loop</code>. Any idea?</p>

<pre><code>ArrayList courseNames=new ArrayList();

String []values=request.getParameterValues("ToList");

for(int i=0;i&lt;values.length;i++)
    courseNames.add(values[i]);
</code></pre>
