title: Spring MVC and Request Attributes
body: <p>I think the original question was confusing. </p>
  
  <p>I have a HashMap that needs to be a Collection from a database that I'd like to send to a view via a Spring Controller. I don't want to put this HashMap in the model.addAttribute() because the Spring Model object returns a Map and my JSP needs the collection to be a <code>Collection&lt;Object&gt;</code>. If I set my HashMap.values() in a request.setAttribute, how do I go about dispatching that request variable to the view if my method is returning a String?</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.GET)
  public String home(Locale locale, Model model, HttpServletRequest request) {
  
      model.addAttribute("surveys", mySurveys); //this is a map and I need a Collection&lt;Object&gt;
  
      //So I'd like to do this, but how do I get to the "evaluations" object in a view if I'm not dispatching it (like below)??
      request.setAttribute("evaluations", mySurveys);
  
      //RequestDispatcher rd = request.getRequestDispatcher("pathToResource");
      //rd.forward(request, response);
  
      return "home";
  }
  </code></pre>
  
  <p>EDIT: The Spring Tag library cannot be used for this particular usecase.</p>
  
  <p>Thanks.</p>