iframe,页面框架,可实现不刷新,在局部打开新页面展示数据
代码示例:
<div class="left">
<ul id="menu">
<li><a href="person/newslist" target="mainFrame">信息管理</a></li>
<li><a href="person/pwdedit" target="mainFrame">密码修改</a></li>
</ul>
</div>
<div class="right">
<iframe name="mainFrame" src="" style="border: 0px;height: 100%;width: 100%"></iframe>
</div>
Java跳到指定位置 :
String script = "<script>parent.window.location.href='" + request.getContextPath() + "/login'</script>";
try {
PrintWriter out = response.getWriter();
out.print(script);
out.close();
} catch (IOException e) {
e.printStackTrace();
}