从默认的index.jsp页面跳转或转发到其他页面

使用forward还是redirect都可以完成跳转

   

 

forward:浏览器地址不变,所以存在重复提交的问题

   <%  pageContext.forward("student/list");   %>

redirect:改变地址

 <%  response.sendRedirect("student/list");  %>

 

使用js也可以

<!-- 使用script脚本 页面跳转,标题拦网址会随着请求的改变而改变。-->
<script type="text/javascript">
window.location = "showip.html";
</script>

posted @ 2018-11-12 15:29  不打鱼光晒网  阅读(1782)  评论(0)    收藏  举报