How to check the URL is http or https through programmatically using HttpServlet. If the Url is http send message as Warning otherwise message as Allow.
How to prevent HTTP Url and allow HTTPS through programmatically.
You can detect HTTPS inside a servlet via servletRequest.isSecure().
To force use of HTTPS, just configure secure Urls in your web.xml. The when users go to HTTP they will be redirected to HTTPS.
configure secure Urls can be redirect from other protocols to https. My question is how to prevent other protocols. When we have use https allow the web page, otherwise block/prevent Other protocols.http://appengine.google.com in this URl is automatically redirect to https://appengine.google.com. I don't like this mechanism. For example I need when users use this sample URL http://appengine.google.com browsers redirect to 404 or 505 or any Error Message. Is it possible?