protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// 设置编码
req.setCharacterEncoding("UTF-8");
// 接受页面得值
String command = req.getParameter("command");
String description = req.getParameter("description");
// 想页面传值
req.setAttribute("command", command);
req.setAttribute("description", description);
QueryService listService = new QueryService();
// 数据传输值
req.setAttribute("messageList", listService.queryMessageList(command, description));
// 查询消息列表并传值
req.getRequestDispatcher("/WEB-INF/jsp/back/list.jsp").forward(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException { |