List.jsp 其navtabId為TradingStrategy_31; <form method="post" action="${contextPath}/tts/stock/tradingstrategy/create" class="pageForm required-validate" onsubmit="return validateCallback(this,navTabAjaxDone);" >/** 這句很重要**/ <div class="pageHeader"> <div class="searchBar"> <ul class="searchContent"> <li> <label style="width: 100px;">股票代碼:</label> <input type="text" name="code"/> </li> <li> <label style="width: 100px;">起始日:</label> <input type="text" name="startDay"/> </li> <li> <label style="width: 100px;">結束日:</label> <input type="text" name="endDay"/> </li> </ul> </div> </form> <div class="pageContent" layoutH="160"> <div class="panelBar"> <ul class="toolBar"> <li><a class="delete" target="selectedTodo" rel="ids" href="${contextPath}/tts/stock/tradingstrategy/delete" title="確認要刪除?"><span>刪除交易策略</span></a></li> </ul> </div> <table class="table" layoutH="162" width="100%"> <thead> <tr> <th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th> <th width="100">股票代碼</th> <th width="100">起始日</th> <th width="100">結束日</th> <th >買賣標志</th> <th >觸發條件</th> <th >委托價格</th> <th >委托數量</th> <th >證券市場</th> <th >報價方式</th> <th >狀態碼</th> <th >委托單號</th> <th >委托時間</th> <th >交易賬戶類型</th> <th width="130" orderField="createTime" class="${page.orderField eq 'createTime' ? page.orderDirection : ''}">創建時間</th> </tr> </thead> <tbody> <c:forEach var="item" items="${tradingStrategy}"> <tr target="slt_uid" rel="${item.id}"> <td><input name="ids" value="${item.id}" type="checkbox"></td> <td>${item.code}</td> <td>${item.startDay}</td> <td>${item.endDay}</td> <td>${item.bsFlag}</td> <td>${item.triggerCondition}</td> <td>${item.price}</td> <td>${item.quantity}</td> <td> <c:if test="${item.market==1 }">深市</c:if> <c:if test="${item.market==0 }">滬市</c:if> </td> <td> <c:if test="${item.entrustProp=='O' }">限價委托</c:if> <c:if test="${item.entrustProp=='Q' }">對手方最優價格</c:if> <c:if test="${item.entrustProp=='S'}">本方最優價格</c:if> <c:if test="${item.entrustProp=='T' }">即時成交剩余撤銷</c:if> <c:if test="${item.entrustProp=='U' }">五檔即成剩余撤銷</c:if> <c:if test="${item.entrustProp=='V'}">全部成交或撤銷</c:if> <c:if test="${item.entrustProp=='R'}">五檔即成剩余轉限</c:if> </td> <td>${item.status}</td> <td><c:if test="${item.orderDate!=null }">${item.orderNo}</c:if></td> <td>${item.orderDate}</td> <td>${item.accountType}</td> <td><fmt:formatDate value="${item.createTime}" pattern="yyyy-MM-dd"/></td> </tr> </c:forEach> </tbody> </table> <!-- 分頁 --> <dwz:pagination page="${page }"/> </div> spring mvc 服務器端代碼 AjaxObject ajaxObject = new AjaxObject("添加交易策略成功!"); ajaxObject.setNavTabId("TradingStrategy_31"); ajaxObject.setCallbackType("");//必不可少; 這句很重要 // ajaxObject.setRel("jbsxBox2trading_List"); // ajaxObject.setForwardUrl("http://localhost:8080/tts/stock/tradingstrategy/create_list"); return ajaxObject.toString(); 服務器端返回代碼 {“statusCode”:”200″,”message”:”添加交易策略成功”, “callbackType”:”closeCurrent”,”forwardUrl”:”",“navTabId”:”TradingStrategy_31”}
上述轉自網絡,下面有一種我發現的更簡單的方法,只需要一句代碼即可:
location.reload();