java web 将http 强转为https

在web.xml中添加如下:

<!-- add by jim -->
<security-constraint>
    <web-resource-collection>
        <web-resource-name>SSL</web-resource-name>
<!-- 任意url --> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>

服务器为resin,需要在confi.xml文件中添加

   <http port='443'>
       <jsse-ssl>
     <key-store-file>dyxnettest.jks</key-store-file>
     <password>test123</password></jsse-ssl>
  </http>

 

posted @ 2015-10-10 16:09  jimw  阅读(1208)  评论(0编辑  收藏  举报