title: Can't cast object to array of custom class
body: <p>I have the following servlet code:</p>
  
  <pre><code>    SearchResult[] basicResults = AuctionSearchClient.basicSearch(search, numToSkip, numToReturn);
  
      request.setAttribute("search_result", basicResults);
      request.getRequestDispatcher("/search.jsp").forward(request, response);
  </code></pre>
  
  <p>Then in my search.jsp file I have the following code:</p>
  
  <pre><code>SearchResult[] searchResult = (SearchResult[])request.getAttribute("search_result");
  </code></pre>
  
  <p>However I am getting an error saying:</p>
  
  <blockquote>
    <p>SearchResult cannot be resolved to a type</p>
  </blockquote>
  
  <p>request is an object of type HttpServletRequest.
  Why am I getting this casting error? </p>