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

问题描述:

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

解决办法:

 

[html]  view plain  copy
 
  在CODE上查看代码片 派生到我的代码片
  1. <!-- redirectHttp10Compatible:解决https环境下使用redirect重定向地址变为http的协议,无法访问服务的问题  
  2.                    设置为false,即关闭了对http1.0协议的兼容支持  
  3.  -->  
  4.     <bean id="viewResolver"  
  5.         class="org.springframework.web.servlet.view.InternalResourceViewResolver">  
  6.         <property name="viewClass"  
  7.             value="org.springframework.web.servlet.view.JstlView" />  
  8.         <property name="prefix" value="/WEB-INF/pages/" />  
  9.         <property name="suffix" value=".jsp" />  
  10.         <property name="redirectHttp10Compatible" value="false" />  
  11.     </bean>  

猜你喜欢

转载自wb284551926.iteye.com/blog/2374659