JSP页面加载直接跳转到Servlet,以及html页面加载跳转到另一个页面

<script type="text/javascript">
     function directUrl() {
      window.location.href=”Servlet地址“ + 参数列表;
     return;
}
</script>
<body onload="directUrl()">
</body>

<html>

<head>
<meta HTTP-EQUIV="Content-Type" content="text/html"; charset="gbk">
<meta HTTP-EQUIV="refresh" content="0.1;url=http://127.0.0.1:8080/NetBook/ViewServlet">

</head>
<body></body>

</html>


两种跳转的方式

一种跳转路径为url中的路径

另外一种使用javascript跳转

猜你喜欢

转载自blog.csdn.net/zhangkaixu321/article/details/8950538