title: How can I get an object out of the model in the controller with Spring MVC 3?
body: <p>I have a controller with a method that handles incoming <code>GET</code> data, stores some things in the <code>model</code>, and then redirects to another page that deals with these objects. </p>
  
  <p>I can't seem to find any good way of getting the object stored in the first method back out of the model to use in the second method. How can I do this?</p>
  
  <p>Here's the top of the controller:</p>
  
  <pre><code>@Controller
  @RequestMapping("/reviews")
  @SessionAttributes({"review", "externalReview"})
  public class ReviewController {
      // [SNIP]
  }
  </code></pre>
  
  <p>Here's the code that adds the objects I'm after to the model:</p>
  
  <pre><code>@RequestMapping(value="/new", params="UName", method=RequestMethod.GET)
  public String newFormFromExternal(@ModelAttribute("externalReview") ExternalReview externalReview, Model model) throws IncompleteExternalException {
      // Convert the inbound external
      Review fromExternal = ExternalReviewUtil.reviewFromExternalReview(externalReview, externalDAO);
  
      // Add the externalReview to the session so we can look to see if we got a reviewee on the way in
      model.addAttribute("externalReview", externalReview);
  
      model.addAttribute("review", fromExternal);
  
      return "redirect:/reviews/newFromExternal";
  }
  </code></pre>