各位大大
  
   现在正在学java的WEB开发。用的struts2+tomcat6+mysql。  最下面是一个页面。名字叫student.jsp。里面有嵌套一个addstudent.jsp我用红的标注出来了。 这个也是从网上拷的。不大了解,只知道是一个嵌套在jsp里面的jsp 我现在想在我点外面这个jsp上的左边下拉条的内容的时候里面的那个jsp可以变动,而外面的不变。 不知道有没有一些简单易行的方法。  上网找了,可是貌似都是说局部刷型的问题好像是AJAX,我现在还不想马上又加一个头痛的东西  呵呵。有知道的麻烦指点一下。  不好意思,就这么多分了~~~ 见谅
<%@ page language="java" import="java.util.*" pageEncoding="gb2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><link href="App_Themes/Normalle/main.css" type="text/css" rel="stylesheet" /><link href="App_Themes/Normalle/StyleSheet.css" type="text/css" rel="stylesheet" /><title>

        培训管理系统
    
</title><link href="Common/index.css" rel="stylesheet" type="text/css" />    <script type="text/javascript">
     setInterval("back()",2000);
  
    function test(html)
    {         
        document.getElementById('Label2').innerHTML = html;
    }    </script>    <script>
function close(){ 
    if(document.body.clientWidth-event.clientX< 170&&event.clientY< 0 ||event.altKey) { 
       document.getElementById("Button1").click();
    }  

window.onbeforeunload=close;
    </script>    <style type="text/css">
        A:link,A:visited{ text-decoration:none; color:#ffffff; }
        </style>    <script type="text/javascript" src="Common/xhttp.js"></script></head>
<body >
    <div>
        <table cellspacing="0" cellpadding="0" width="100%" border="0" background="images/top_02.gif">
            <tbody>                    <td align="left">
                        <img src="images/logo1.png" 
                            style="width: 235px; height: 57px"/>&nbsp;</td>
                    <td width="47%" valign="top" align="right">
                        <table cellpadding="0" id="table18">
                            <tbody>
                                <tr>
                                    <td align="right">
                                        <table cellspacing="2" cellpadding="0" width="0%" border="0" id="table19">
                                            <tbody>
                                                <tr>
                                                    <td>
                                                        <img height="16" src="images/mail.gif" width="16"/></td>
                                                    <td valign="bottom" >
                                                        <a href="login.jsp">返回首页</a></td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                    <td class="gtsep" align="right">
                                        |</td>
                                    <td  align="right">
                                        <table cellspacing="2" cellpadding="0" width="0%" border="0" id="table20">
                                            <tbody>
                                                <tr>
                                                    <td>
                                                        <img height="16" src="images/write.gif" width="16"/></td>
                                                    <td valign="bottom" >
                                                        <a href="help/Default.aspx" target="_blank">使用帮助</a></td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                    <td class="gtsep" align="right">
                                        |</td>
                                    <td  align="right">
                                        <table cellspacing="2" cellpadding="0" width="90" border="0" id="table23">
                                            <tbody>
                                                <tr>
                                                    <td>
                                                        <img height="16" src="images/sys_out.gif" width="16"/></td>
                                                    <td valign="bottom">
                                                        <a href="login.jsp">退出系统</a></td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <table height="36px" style="color: white">
                            <tr>
                                <td valign="bottom">
                                    今天是:                                    <script type="text/javascript">
                                         todayDate = new Date();
                                         date = todayDate.getDate();
                                         month= todayDate.getMonth() +1;
                                         year= todayDate.getYear();
                                        if(navigator.appName == "Netscape")
                                        {
                                      document.write(1900+year);
                                      document.write("年");
                                      document.write(month);
                                      document.write("月");
                                      document.write(date);
                                      document.write("日");
                                        }
                                       if(navigator.appVersion.indexOf("MSIE") != -1)
                                       {
                                          document.write(year);
                                          document.write("年");
                                          document.write(month);
                                          document.write("月");
                                          document.write(date);
                                          document.write("日&nbsp;");                                       }
                                      if (todayDate.getDay() == 5) document.write("星期五")
                                      if (todayDate.getDay() == 6) document.write("星期六")
                                      if (todayDate.getDay() == 0) document.write("星期日")
                                      if (todayDate.getDay() == 1) document.write("星期一")
                                      if (todayDate.getDay() == 2) document.write("星期二")
                                      if (todayDate.getDay() == 3) document.write("星期三")
                                      if (todayDate.getDay() == 4) document.write("星期四") 
                                    </script>                                </td>
                            </tr>
                        </table>
            </tbody>
        </table>
        <table cellspacing="0" cellpadding="0" width="100%" border="0" background="images/top_02.gif">
            <tbody>
                <tr>
                    <td background="images/bg1.gif" style="height: 31px">
                    </td>
                    <td colspan="2" background="images/bg1.gif" style="height: 31px">
                        <table border="0" width="100%" id="table7">
                            <tr>
                                <td align="right">
                                    &nbsp;您好:<span id="Label1">令狐冲     </span>&nbsp;&nbsp;&nbsp;您的身份是:<span id="pgShengfeng">管理岗教师</span>&nbsp;&nbsp;&nbsp;当前在线人数:
                                </td>
                                <td align="left">
                                    <span id="Label2"></span>
                                </td>
                            </tr>
                            <tr height="5">
                                <td align="left" style="font-size: 1px;">
                                </td>
                                <td style="font-size: 1px;">
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    
    <table cellspacing="0" cellpadding="0" width="100%" border="0">
        <tr>
            <td width="152" height="580" style="background-color: #f5f3f4;" valign="top">
                <iframe src="tea1_MenuList.jsp" scrolling="no" frameborder="0" height="100%" width="100%">
                </iframe>
            </td>
            <td valign="top" background="images/line.jpg" style="background-image: url(images/line.jpg);
                font-size: 1px;" bgcolor="#f5f3f4" width="1%">
                &nbsp;</td>
            <td height="580px" rowspan="2" colspan="2" valign="top">
                <iframe src="addStudent.jsp" scrolling="no"
                    frameborder="0" height="100%" width="100%"></iframe>
            </td>
        </tr>
    </table>
</body>
</html>

解决方案 »

  1.   

    addStudent.jsp中的head标签里增加
    <base target="_self"/>以后在addStudent.jsp中无论做什么操作,都只会刷新他本身,而不影响外面的页面。<jsp:include page=""/>不能解决你的问题。
      

  2.   

    我现在这样  在addstudent.jsp里面提交,然后跳转没问题。我是想点外面的JSP 然后里面的JSP进行改变这样可以吗?
      

  3.   

    <form target="testframe">
    </form><iframe name="testframe" id="testframe"></iframe>
      

  4.   

    将form的target和iframe的name设置成一样,点提交按钮或者是form.submit,就可以只刷新iframe的区域了。
    我还在工作,没环境啊。。
      

  5.   

    动态包含,静态包含
    Google,百度
    搜一下