新梦想网络 > 客服中心 > 独立服务器 > 正文缩放字号: [收藏本问题]

部署https(ssl)后设置301跳转将http跳转到https(tomcat)

时间:2017-03-17来源:新梦想网络 作者:新梦想网络 点击:
  在web.xml最后一行</web-app>代码之前添加如下代码即可
 

<security-constraint>
    <!-- Authorization setting for SSL -->
    <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>
</security-constraint>

    TAG:

    下载此文章 (欢迎转载,请注明出处:http://www.xmxwl.net/help/member/20170317/13821.html)