使用windows.location.href时,Tomcat https调用被重定向到http

时间:2015-05-29 07:55:24

标签: javascript tomcat

我在已安装的Tomcat 6的ROOT文件夹中添加了一个已修改的index.html文件,该文件将用户重定向到我的主应用程序。但是,当我使用https协议访问此站点时,它使用http协议进行重定向,为什么会这样,以及如何克服它?

以下是代码段

<script  language="Javascript">
  var url='/MainApp/jsp/index.jsp';
  window.location.href = url;
</script>

UPDATE

    <?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Apache Tomcat</title>
<style type="text/css">
/*<![CDATA[*/
  body {
      color: #000000;
      background-color: #FFFFFF;
      font-family: Arial, "Times New Roman", Times, serif;
      margin: 10px 0px;
  }

img {
   border: none;
}

a:link, a:visited {
    color: blue
}

th {
    font-family: Verdana, "Times New Roman", Times, serif;
    font-size: 110%;
    font-weight: normal;
    font-style: italic;
    background: #D2A41C;
    text-align: left;
}

td {
    color: #000000;
font-family: Arial, Helvetica, sans-serif;
}

td.menu {
    background: #FFDC75;
}

.center {
    text-align: center;
}

.code {
    color: #000000;
    font-family: "Courier New", Courier, monospace;
    font-size: 110%;
    margin-left: 2.5em;
}

 #banner {
    margin-bottom: 12px;
 }

 p#congrats {
     margin-top: 0;
     font-weight: bold;
     text-align: center;
 }

 p#footer {
     text-align: right;
     font-size: 80%;
 }
 /*]]>*/
</style>
<script  language="Javascript">
 var url='/ZumigoUI/jsp/index.jsp';
 window.location.href = url;
</script>
</head>

<body>
</body>
</html>

0 个答案:

没有答案