Hi,
I need to construct a fully qualified URL in my
JSP, to redirect the client to a page which could be on the same server or on a different server.
Is there a direct way to get the protocol(http or htttps) of the current request ?
I've tried a couple of approaches:
request.getProtocol() - returns the string HTTP/1.1. I cannot use this string in my URL, without some kind of string manipulation.request.getURI() - gives me the protocol being used (http:// or https://), but again, I cannot use it without string manipulation. It feels like there should be a simple way to get the protocol of the current request and use it to construct a new fully qualified URL. Any help would be appreciated. Thanks.