By many online solutions, most of them are redirected, or jump page, but I have not tried out the original frame, later found to achieve the specified frame to jump from servlet frameset can directly target form form , which do not have to deal with the trouble of the servlet
1 <form action="${pageContext.request.contextPath}/MessageServlet method=search" target="mainFrame" method="post" id="formid"> 2 <input type="text" name="content" id="content" /> 3 <a href="#" target="topFrame" id="sub" onclick="searchTopic()">提交</a> 4 </form> 5 6 <script type="text/javascript"> 7 function searchTopic() 8 { 9 document.getElementById("formid").submit(); 10 } 11 </script>