一个jsp里面,怎么实现另外两个jsp页面同时显示??

<%@ page contentType="text/html;charset=GBK" %>
<html>
<head><title>用户管理页面</title>
<script type="text/javascript" >

function mmupdate(){
document.getElementById("a").src="/member/account/mmupdate.jsp";

}
function zlupdate(){
document.getElementById("a").src="/member/account/zlupdate.jsp";

}

</script>

</head>
<body bgcolor="0088ff">
<table width="1024" height="auto" style="border:"0";" align="center" >
<tr>
<td width="210px">这个方放置栏目 </td>
<td><iframe id="a" style="height:500px; width: 100%;" src="/member/account/mmupdate.jsp"></iframe></td>
</tr>
</table>
</body>
</html>

1、首先新建两个JSP页面,如下图所示。

2、然后在a.jsp页面中,输入如下代码。

3、接着在b.jsp页面中输入如下代码。

4、然后访问a.jsp页面,发现浏览器中显示的是b.jsp页面的内容。

5、说明代码<jsp:forward page="b.jsp"></jsp:forward> 起到了页面跳转的作用。它等同于如下代码。

6、访问后也是同样的跳转,就完成了。

温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2017-09-02

两种方式:

1、通过<%@include file=""%>方式把两个jsp页面放入同一个页面中

<body>
<%@include file="页面1.jsp"%>
<%@include file="页面2.jsp"%>
</body>

2、通过iframe方式,把2个页面嵌入到同一个jsp页面中

<body> 
  <iframe src='页面1.jsp'/>
  <iframe src='页面2.jsp'/>
</body>

第2个回答  2011-05-28
你写的用iframe就可以啊,或者用JSP的include标签,只不过要放到服务器上(比如tomcat)才能看到效果的,直接在本地用浏览器打开,它只是把你源代码现出来本回答被提问者采纳
第3个回答  2011-05-28
可以使用jsp中include,分别是
< %@ include file=” ”% >
< jsp:include page=” ” flush=”true”/ >
第4个回答  2011-05-28
显示页面: xianshi.jsp