Pom.xml
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>
Controller
@Controllerpublic class RedirectController {@RequestMapping("/foo")void handleFoo(HttpServletResponse response) throws IOException {response.sendRedirect("http://www.baidu.com");}}
