1、首先对Tomcat进行认证配置(参见:https单向/双向认证的tomcat配置攻略)
http://xiaohuafyle.iteye.com/blog/1538719
2、修改tomcat下的conf的web.xml文件,在</web-app>前面增加要https访问的路径的配置。如:(下面代表以 /mm/或/fi/开头的路径系统将自动转为https)
<security-constraint>
<web-resource-collection>
<web-resource-name>must https</web-resource-name>
<url-pattern>/mm/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>must https</web-resource-name>
<url-pattern>/fi/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>