2012-04-17 80 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生成整個頁面,應該調用它來再次生成頁面。