方法一:配置文件修改ViewResolver的 redirectHttp10Compatible 属性,这个属性是为了兼容 http1.0协议。

解决springmvc中使用redirect跳转后https变为http
<bean >
  <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
  <property name="prefix" value="/" />
  <property name="suffix" value=".jsp" />
  <property name="redirectHttp10Compatible" value="false" />
</bean>
解决springmvc中使用redirect跳转后https变为http

方法二:在代码中不直接用 return "redirect:/xxx",而改为使用 

modelAndView.setView(new RedirectView("your redirect URL",true,false));

相关文章:

  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2022-02-25
  • 2021-08-08
猜你喜欢
  • 2021-12-03
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案