hooyantsing's Blog

页面跳转

字数统计: 120阅读时长: 1 min
2019/12/21

页面跳转

Jsp 和 Java(servlet)

request

1
request.getRequestDispatcher("url").forward(request, response);

response

1
response.sendRedirect("url");

javaScript

1
2
3
4
5
6
7
8
1、在原来的窗体中直接跳转用
<script type="text/javascript">
  window.location.href="你所要跳转的页面";
</script>
2、在新窗体中打开页面用:
<script type="text/javascript">
  window.open('你所要跳转的页面');
</script>

解决window.location.href不跳转,无反应,不执行的问题

https://blog.csdn.net/q1054261752/article/details/70256610

CATALOG