I am trying to create an example that uses HTTPS connection. I have successfully configured a custom certificate following the steps given in Tomcat 6.0 documentation. A https://localhost:8443/ successfully opens the Tomcat index page.
I am unable to configure a page/servlet to open in HTTPS. Would anyone please suggest me the steps to configure a webapp to automatically redirect itself into a HTTPS connection.
Requests using HTTP (non-secure) for URLs whose transport guarantee is CONFIDENTIAL are automatically redirected to the same URL using HTTPS.
Add the following to your web.xml