title: SPRING forward with params
body: <p>I'm trying to forward the request to another controller.
  It seems to forward correctly but another controller doesn't get the parameters I specified.
  Here's my code:</p>
  
  <pre><code>@RequestMapping(value = "/register", method = RequestMethod.POST)
  public String registerUser(@RequestParam("name") String name,
                             @RequestParam("email") String email,
                             @RequestParam("pswd") String password,
                             HttpServletRequest request) throws IOException {
      try {
          manager.getTransaction().begin();
          User user = new User();
          user.setName(name);
          user.setEmail(email);
          user.setPassword(password);
          manager.persist(user);
          manager.getTransaction().commit();
      } catch (Exception e) {
          manager.getTransaction().rollback();
          request.setAttribute("errorMessage", e.getMessage());
          return "forward:/error";
      }
      request.setAttribute("email", email);
      return "forward:/main";
  }
  </code></pre>
  
  <p>The other controller:</p>
  
  <pre><code>@RequestMapping("/error")
  public ModelAndView throwError(@RequestParam (value = "errorMessage") String errorMessage) {
      return new ModelAndView("error", "errorMessage", errorMessage);
  }
  </code></pre>
  
  <p>The error that I get is (in browser):</p>
  
  <pre><code>HTTP Status 400 - Required String parameter 'errorMessage' is not present
  </code></pre>
  
  <p>So the question is why does the request not contains the <code>errorMessage</code> attribute? What is wrong?</p>