raghujosh 0 Junior Poster

I have an application which accesses a catalog of items which can then be added to a cart. When a user selects the item(s) which could be "n" number by checking a checkbox and clicking the "Add to cart" button, the data has to be posted to a cartservlet. I am using the following code on the servelet to accept requests

ArrayList<String> items = new ArrayList<String>();
items = request.getParameterValues("itemNo") //itemNo is the value of the checkbox array  in the JSP.

I want to further process this arraylist on the servlet.

But I get a status 500 error for a nullpointer exception. The arraylist "items" is null. How can I then post values to this arraylist(in the servlet) from the array in the JSP?