使用Jetty作为应用服务器。如果我在浏览器中输入IP地址,如何使其默认为https?
首先,您需要为https配置一个连接器,如下所示:
http://www.eclipse.org/jetty/documentation/current/configuring-ssl.html如果你想只允许https,那么在你的web应用程序中添加一个安全约束,如下所示:
http://docs.oracle.com/javaee/5/tutorial/doc/bncbe.html bncbm
将所有发送到http连接器的请求重定向到https连接器。