让用户访问Tomcat时强制跳转到Https方式。
首先配置Tomcat可以在Https下运行,相应的配置,请查看其它说明文档。
http://www.iteye.com/topic/78274
修改tomcat/conf/web.xml文件,在 </welcome-file-list> 下面加上如下语句
<login-config>
<!-- Authorization setting for SSL -->
<auth-method>CLIENT-CERT</auth-method>
<realm-name>Client Cert Users-only Area</realm-name>
</login-config>
<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>
标签:Tomcat,用户,访问,Https,跳转,强制
From: https://blog.51cto.com/u_16237557/7263439