Spring Boot重定向的使用方法

2021-05-16 18:28

阅读:431

标签:http   throws   ppi   end   throw   重定向   als   eth   false   

 1 @RequestMapping(value = "/redirect", method = RequestMethod.GET)
 2     public void redirecttest(@RequestParam(value = "account",required=false) String account,
 3                              @RequestParam(value = "pwd",required=false) String pwd,
 4                              HttpServletRequest request,
 5                              HttpServletResponse response) throws IOException {
 6         log.info(request.getHeader("Host"));
 7         if(account.equals("123456789@qq.com") && pwd.equals("123456")){
 8             response.sendRedirect("http://www.baidu.com");
 9         }
10     }

 

Spring Boot重定向的使用方法

标签:http   throws   ppi   end   throw   重定向   als   eth   false   

原文地址:https://www.cnblogs.com/andrew209/p/9748357.html


评论


亲,登录后才可以留言!