You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by smiley <in...@gmail.com> on 2012/09/15 21:42:56 UTC

Why does isSecure()return true and getScheme() always return https even when the request url is http?

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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org