I have a webstore written in pure JSP and JavaBeans which is deployed and working fine on Tomcat. Tomcat has been configured with SSL successfully. It only has five pages:
- Home page (non-secure page) - Displays home page
- Product page (non-secure page) - Display a single product all the time
- Cart page (non-secure page) - Displays the cart page after adding a product
- Checkout page (secure page) - A single checkout page that contains all the information such as customer address, payment method, shipping method etc
- Receipt page (secure page) - Generates an Order # and displays order total.
Whenever I navigate from Cart page to Checkout page the browser automatically switches the protocol from http -> https and port from 8080 -> 8443 which is as expected. However, the problem is that  it just does not switch it back from https -> http and 8443 -> 8080 whenever the user navigates from Checkout page to Home/Product page. The Home/Product and Cart page url's all get converted into secure pages which is not something I want.
web.xml
<!-- Security for Checkout module -->
<security-constraint>
    <web-resource-collection>
        <web-resource-name>mycheckout</web-resource-name>
        <url-pattern>/jsp/checkout/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>
Folder Structure:
jsp/
    home.jsp
    product.jsp 
    cart.jsp
    checkout/
        checkout.jsp
        receipt.jsp
 
     
    