首页 > Web开发 > 详细

jsp查询页面和结果页面在同一页面显示和交互

时间:2015-08-30 22:51:49      阅读:291      评论:0      收藏:0      [点我收藏+]

用frameset实现查询页面和结果页面在同一页面

用target实现交互显示在同一页面上

请参照以下方法解决:

main.jsp:
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=GBK">
 <title>Insert title here</title>
 </head>
 <body>
 <frame>
 <iframe name="query" src="query.jsp"></iframe>
 <iframe name="list"></iframe>
 </frame>
 </body>
 </html>

 query.jsp:
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 <title>Insert title here</title>
 </head>
 <body>
 <form action="list.jsp" method="post" target="list">
 <input type="text" name="theName">
 <input type="submit" value="Submit">
 </form>
 </body>
 </html>


 list.jsp:
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 <title>Insert title here</title>
 </head>
 <body>
 <%String result=request.getParameter("theName"); %>
 <%=result %>
 </body>
 </html> 

 

jsp查询页面和结果页面在同一页面显示和交互

原文:http://www.cnblogs.com/zzlp/p/4771681.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!