springboot实现301跳转
@GetMapping(value = {"", "/"})
public void toIndex(HttpServletRequest request, HttpServletResponse response, Model model) throws IOException {
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
response.setHeader("Location", Constants.url + "/en");
// response.sendRedirect("/en");
}