title: java.util.Vector cannot be cast to java.util.ArrayList
body: <p>I am trying to return an ArrayList of database search results from a servlet to be displayed on a jsp page. </p>
  
  <p>Setting the arraylist as an attibute of request in the servlet and forwarding the request to the jsp page. when I try to retrieve it on the jsp page it it gives the following error:</p>
  
  <p>"java.util.Vector cannot be cast to java.util.ArrayList"</p>
  
  <p>The servlet code:</p>
  
  <pre><code>List&lt;Car&gt; ResultList=SearchPartsDAO.displaySearchResults(car);
          if(ResultList.size()&gt;=1){
              request.setAttribute("ResultList", ResultList);
              request.getRequestDispatcher("SearchResults.jsp").forward(request, response);
          }else
              response.sendRedirect("NotFound.jsp");
  </code></pre>
  
  <p>The JSP:</p>
  
  <pre><code>&lt;body&gt;
  &lt;% 
  ArrayList&lt;Car&gt; resultList = new ArrayList&lt;Car&gt;();
  resultList=(ArrayList&lt;Car&gt;)request.getAttribute("ResultList");
  %&gt;
  &lt;%System.out.println(resultList.get(0).getCarMake());%&gt;
  </code></pre>