web整站https环境下使用(spring mvc)redirect重定向到http协议问题

来源:互联网 发布:滨州行知中学招聘 编辑:程序博客网 时间:2024/04/25 17:45

参考:

我的理解:http协议中302和303的区别

springmvc redirect prefix always redirects to http,how do i make it stay

问题描述:

        项目部署在websphere中,整站在https下运行,当通过spring redirect 内部跳转时,链接地址有https开头转变为http开头,在这样情况下导致项目请求无法访问。

解决办法:

<!-- redirectHttp10Compatible:解决https环境下使用redirect重定向地址变为http的协议,无法访问服务的问题               设置为false,即关闭了对http1.0协议的兼容支持 --><bean id="viewResolver"class="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="viewClass"value="org.springframework.web.servlet.view.JstlView" /><property name="prefix" value="/WEB-INF/pages/" /><property name="suffix" value=".jsp" /><property name="redirectHttp10Compatible" value="false" /></bean>


1 0
原创粉丝点击