开发者

Switching between HTTPS and HTTP in Java web application

I have set up SSL in Tomcat 5.5 and have the follo开发者_StackOverflow中文版wing in my 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>

which works fine when I submit the login form that has the action url of 'j_spring_security_check' but then when I navigate to any other URL in the app, the app is stuck using the SSL port with https in the URL.

How can I only use HTTPS for some URLs but make the application revert to plain HTTP for other URLs?


It might not be the answer you're looking for, but have you considered staying over HTTPS?

From this article:

SSL/TLS is not computationally expensive any more.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜