我要做个页面,左边放一列按钮,点击按钮读数据库在右边显示不同的页面或数据,这个页面怎么写?JSP

解决方案 »

  1.   

    如果页面刷新的话,可以将链接写入按钮,到对应的action中,获取数据库的结果集,返回至页面的右边。
    如果不刷新页面的话,楼主可以用ajax实现,挺简单的。
      

  2.   

    可以用frameset 框架, 分为左右两部分,左面写按钮,右面显示你数据库读取的数据或者页面
      

  3.   

    同意楼上,使用frameset,把按钮改成超链接传递参数,到servlet,如果是ssh框架的话就是action,在里面添加查询函数。
      

  4.   

    你也可以使用div将左边的按钮包围起来,然后使用左浮动。
      

  5.   

    各位大虾,能否写个简单的jsp页面例子来解说一下呢,纯文字我比较不好理解啊~~~!!!
      

  6.   

    其实办法有很多种:
    1、用Ajax动态更新(要求对ajax有概念)
    2、用iframe,
    3、用frameset 
      

  7.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
     <head>
      <title>后台管理系统</title>
      <meta name="Author" content="">
      <meta name="Keywords" content="">
      <meta name="Description" content="">
     </head>

    <frameset rows="93,*" cols="*" frameborder="yes" border="0px" bordercolor="#0970BB" framespacing="0px">
      <frame src="/qiyueOA/frame/top.jsp" name="topFrame" noresize="noresize" bordercolor="#0970BB" scrolling="No"  id="topFrame" title="topFrame" />
      <frameset cols="213,*" frameborder="yes" border="0px" framespacing="0px" bordercolor="#0970BB">
        <frame src="/qiyueOA/frame/menu_left.jsp" name="leftFrame" noresize="noresize" scrolling="No" id="leftFrame" title="leftFrame" bordercolor="#0970BB" />
        <frame src="/qiyueOA/frame/con_center.jsp" name="mainFrame" noresize="noresize" id="mainFrame" title="mainFrame" />
      </frameset>
    </frameset>
    </html>这是页面的结构 上边是logo 左边是菜单列表 右边是 不同菜单对应的内容显示区域 
    菜单按键对应的链接要指到所要显示的页面区域
    <a href="<%=path %>/work/SendEmail_execute" target="mainFrame">发送邮件</a>
      

  8.   

    <%@ page language="java" contentType="text/html; charset=GB18030"
        pageEncoding="GB18030"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=GB18030">
    <title>Insert title here</title>
    </head>
    <body><frameset rows="50%,50%"><frame src="/MailManagement/jsp/head.jsp" /><frameset cols="25%,75%">
    <frame src="/MailManagement/jsp/button.jsp">
    <frame src="/MailManagement/jsp/content.jsp">
    </frameset></frameset>
    </body>
    </html>我这么写,为什么就不行呢,那几个页面都是简单页面,但是浏览器上一片空白,求解 ~~~~