码迷,mamicode.com
首页 > 其他好文 > 详细

SelectAllServlet

时间:2018-03-11 00:32:53      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:body   man   web   dao   select   red   attribute   https   extend   

package servlet;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import dao.RainManageDao;
import entity.RainManage;
@WebServlet(urlPatterns = {"/selectAll_servlet"})
public class SelectAllServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
RainManageDao dao = new RainManageDao();
List<RainManage> selectAll = dao.selectAll();
HttpSession session = request.getSession();
session.setAttribute("DATA", selectAll);
response.sendRedirect("index.jsp");
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}

SelectAllServlet

标签:body   man   web   dao   select   red   attribute   https   extend   

原文地址:https://www.cnblogs.com/wangyuxin123/p/8542238.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!