title: URL redirection in Java return 302 instead of 301
body: <p>I'm using this code to redirect url:</p>
  
  <pre><code>  response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
    response.sendRedirect(newURL);
  </code></pre>
  
  <p>what I can see is a correct redirection but the value returned in the response is 302 instead of 301. How can I force it to 301?</p>