老師給的后續功能,查找、點擊記錄后面的刪除鏈接以后如何刪除后返回列表而保留搜索結果
protected void doGet(HttpServletRequest request,
?? ??? ??? ?HttpServletResponse response) throws ServletException, IOException {
?? ??? ?// 設置編碼
?? ??? ?request.setCharacterEncoding("UTF-8");
?? ??? ?// 接收頁面的值
?? ??? ?String id = request.getParameter("id");
?? ??? ?MaintainService maintainService = new MaintainService();
?? ??? ?maintainService.deleteOne(id);
?? ??? ?// 向頁面跳轉
?? ???? String command = request.getParameter("command");
?? ??? ?String description = request.getParameter("description");
?? ??? ?request.setAttribute("command", command);
?? ??? ?request.setAttribute("description", description);
?? ??? ?ListService listService = new ListService();
?? ??? ?// 查詢消息列表并傳給頁面
?? ??? ?request.setAttribute("messageList",listService.queryMessageList(command, description));
?? ???? request.getRequestDispatcher("/List.action").forward(request, response);
?? ?}
<a></a>點擊不能觸發上面搜索欄的提交吧?