2012-04-17 39 views
0

在我的应用程序中,我有一个jsp,其中包括3个jsp文件,这3个jsps中有一个jsp与buttons.with按钮按下,我想更改内容accordion2.jsp。 即时消息做什么是一旦按下任何按钮,即时通讯给一个servlet,它从这个servlet做的逻辑part.nw我应该发送请求给accordion2.jsp或包含所有这些jsps的jsp ??下面是脚本,即时通讯使用HTML的摘录。jsp没有得到重新包括

<script type="text/javascript"> 
    $(document).ready(function() { 
     // select all the links with class="lnk", when one of them is clicked, get its "href" value 
     // load the content from that URL and place it into the tag with id="content" 
     $('input.button').click(function() { 

     var url = $(this).attr('src'); 
     alert(url); 
     var status= $(this).attr('value'); 
      alert(status); 
      alert(url+"?name="+status); 
     $('.accordion2').detach(); 
     $('.accordion2').load(url+"?name="+status); 
     alert("after load"); 
     return false; 
     }); 
    }); 
    </script> 



    </head> 

    <body class="bodybg" > 
    <div class="wrapwidth"> 
     <!--put header here --> 
     <%@include file="header.jsp" %> 
     <div class="mainbpdy"> 
      <!--put vetinav here--> 
      <%@include file="vetinav.jsp" %> 

      <div class="sroolable"> 

      <%@include file="accordion2.jsp" %> 

      </div> 
     </div> 
     <div class="footer">footer</div> 

    </div> 
    </body> 
    </html> 
+0

从这个servlet我应该发送请求给accordion2.jsp或包含所有这些jsps的jsp?你有尝试过什么吗? – 2012-04-17 08:22:46

回答

0

如果顶级JSP生成整个页面,应该调用它来再次生成页面。