js实现https与http之间的转换
js实现https与http之间的转换<%String context_1 = request.getContextPath();int port = request.getServerPort();String context = "";String httpsPath = "";if(port==80 || port==443){conte
·
js实现https与http之间的转换
<%
String context_1 = request.getContextPath();
int port = request.getServerPort();
String context = "";
String httpsPath = "";
if(port==80 || port==443){
context = "http://" + request.getServerName() + context_1;
httpsPath = "https://" + request.getServerName() + context_1;
} else {
context = "http://" + request.getServerName() + ":" + port + "" + context_1;
httpsPath = "https://" + request.getServerName() + ":" + port + "" + context_1;
}
%>
更多推荐


所有评论(0)