说明
Spring Boot;微服务;
方法上有注解ResponseBody;
控制器类上有注解RestController;
想要跳转页面,如何跳转
代码
方法加上参数HttpServletResponse response
方法里面加上以下代码
response.sendRedirect("http://XXX.com/XXX.html");
其中"http://XXX.com"是某一个服务的域名(在hosts文件中配置);
"XXX.html"是一个html文件,在要访问的服务的IndexController中指定