title: HTTP redirect: 301 (permanent) vs. 302 (temporary) in Spring
body: <p>I want to make a 301 redirect in Spring, So here the piece of code I use</p>
  
  <pre><code>@RequestMapping(value = { "/devices" } , method = RequestMethod.GET)
      private String initGetForm(@ModelAttribute("searchForm") final SearchForm searchForm,
                              BindingResult result, 
                              HttpServletRequest request,
                              HttpServletResponse response,
                              Model model, Locale locale) throws Exception {
  
  
          String newUrl = "/devices/en";
  
          response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
          response.setHeader("Location", newUrl);
          response.setHeader("Connection", "close");
  
          return "redirect:" + newUrl;
  
  }
  </code></pre>
  
  <p>But checking the IE Developer Tools I got this <strong>Status 302 Moved Temporarily</strong> !</p>