我已经在 Tomcat 5.5 中设置了 SSL,并在我的 web.xml 中包含以下内容:
<security-constraint>
<web-resource-collection>
<web-resource-name>SSL URLs</web-resource-name>
<url-pattern>/j_spring_security_check</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
当我提交具有“j_spring_security_check”操作 url 的登录表单时,它工作正常,但是当我导航到应用程序中的任何其他 URL 时,应用程序被卡在使用 URL 中带有 https 的 SSL 端口。
我如何才能只对某些 URL 使用 HTTPS,而使应用程序对其他 URL 恢复为纯 HTTP?
最佳答案
这可能不是您正在寻找的答案,但您是否考虑过继续使用 HTTPS?
来自 this article :
SSL/TLS is not computationally expensive any more.
关于tomcat - 在 Java Web 应用程序中在 HTTPS 和 HTTP 之间切换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3093485/