title: Trouble determining list size in jsp
body: <p>I'm trying to determine the size of a collection within a view.  I'd like to not have to pass the size like I am in the code below with <code>.size()</code>.  </p>
  
  <pre><code>@RequestMapping(value = "/search/searchAndReplace")
  public ModelAndView searchAndReplace(HttpServletRequest request, HttpServletResponse response) {
      ModelAndView model = new ModelAndView("content/search/searchAndReplace");
  
      List&lt;Content&gt; searchResults = (List&lt;Content&gt;) request.getSession().getAttribute("searchResults");
      model.addObject("searchResults", searchResults);
      model.addObject("searchResultsCount", searchResults.size());
  
      return model;
  }
  </code></pre>
  
  <p>Within my view, when I do <code>${searchResultsCount}</code> things work fine, when I do <code>${searchResults.size()}</code> I get the error <code>Class javax.el.BeanELResolver can not access a member of class java.util.ArrayList$SubList with modifiers "public"</code></p>
  
  <p>I can't figure out why this is choking.  Can someone offer some insight?</p>