Tomcat 默认http重定向到https

447 阅读1分钟

在web.xml末尾加上如下配置:

<web-resource-collection >

          <web-resource-name >SSL</web-resource-name>

          <url-pattern>/*</url-pattern>

   </web-resource-collection>

   <user-data-constraint>

   <transport-guarantee>CONFIDENTIAL</transport-guarantee>

   </user-data-constraint>
前提是Http和Https都可正常访问的情况下。