protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // 設(shè)置編碼 req.setCharacterEncoding("UTF-8"); // 接受頁(yè)面得值 String command = req.getParameter("command"); String description = req.getParameter("description"); // 想頁(yè)面?zhèn)髦? req.setAttribute("command", command); req.setAttribute("description", description); QueryService ?listService = ?new QueryService(); // 數(shù)據(jù)傳輸值 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 {
1 回答

丶包菜
TA貢獻(xiàn)158條經(jīng)驗(yàn) 獲得超233個(gè)贊
頁(yè)面?zhèn)鬟^(guò)來(lái)請(qǐng)求叫Request,你給頁(yè)面?zhèn)髦到蠷esponse??墒悄阋恢痹诓僮鱎equest