200    请求成功

304    从缓存中读取

302 + 响应头中定义location: 重定向

    // 自定义重定向
    @RequestMapping("/customRedirection")
    public void customRedirection(HttpServletResponse response) {
        // 告诉给客户端重定向
        response.setStatus(302);
        response.setHeader("location", "loginPage");
        return;
    }

    // 重定向到登陆页面
    @RequestMapping("/redirectloginPage")
    public String redirectLogin() {
        return "redirect:/loginPage";
    }

 

相关文章:

  • 2022-03-04
  • 2021-07-19
  • 2022-12-23
  • 2021-09-30
  • 2021-07-17
  • 2022-01-05
  • 2021-08-07
猜你喜欢
  • 2021-06-18
  • 2021-08-16
  • 2021-06-05
  • 2022-02-25
  • 2021-04-17
相关资源
相似解决方案