Reputation: 293
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.
Upvotes: 0
Views: 877
Reputation: 80340
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.
Upvotes: 1