我想为“checkout”文件夹下的所有 JSP 页面实现 Tomcat SSL 配置。但其余页面应仅使用 http。但问题是,一旦用户导航到结帐页面,所有非结帐页面也开始使用“https”而不是“http”。我已经完成了所有必要的配置工作,如下所示。无法找出问题所在。请指导。
Tomcat 配置
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="C:\istore.mvc1.keystore"
keystorePass="changeIt" />
web.xml 配置
<security-constraint>
<web-resource-collection>
<web-resource-name>mycheckout</web-resource-name>
<url-pattern>/jsp/secure/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
索引.jsp
<body>
<h1>Hello World! - Non-checkout page</h1><br/>
<!-- Jump to checkout.jsp and use https (Works fine) -->
<a href="jsp/secure/checkout.jsp">Go to checkout</a>
</body>
jsp/安全/checkout.jsp
<body>
<h1>Checkout starts here!</h1>
<!-- Jumps to index.jsp but instead of "http" it uses "https" (DOES NOT WORK AS EXPECTED) -->
<a href="../../index.jsp">Back to Non-checkout page</a>
</body>