How can I know if the request to the servlet was executed using HTTP or HTTPS?

HttpSerlvetRequest.isSecure() is the answer. The ServletContainer is responsible for returning true in the following cases: If the ServletContainer can itself accept requests on https. If there is a LoadBalancer in front of ServletContainer. And , the LoadBlancer has got the request on https and has dispatched the same to the ServletContainer on plain http. In … Read more