I am trying to check for if the request url is secure(https)/http and then
based on that building a response url and passing it to the AJAX function to
populate the sub-dropdowns based on the selected value in the main dropdown.
Why do getScheme() always return https and isSecure() always returns true
even if i am trying to access a site with http://mylink.com ?

 var scheme="<%=request.getScheme()%>";
 var baseurl="<%=request.isSecure()%>"; 
//if the protocol is 'https'
        if (baseurl=='true'){
                var url =
"https://<%=request.getServerName()%><%=request.getContextPath()%>/JsonLookup?z="
+ zone;    
        }
        //if the protocol is 'http' 
        else 
        {       
                alert("inside protocol else");
                var url =
"http://<%=request.getServerName()%><%=request.getContextPath()%>/JsonLookup?z="
+ zone;  
                alert("inside http:"+url); 
        }



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Why-does-isSecure-return-true-and-getScheme-always-return-https-even-when-the-request-url-is-http-tp4652011.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to