package BranchesMgr.servlet; import java.io.IOException; import java.io.PrintWriter; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import BranchesMgr.dao.BranchesDao; import BranchesMgr.dao.impl.BranchesDaoImpl; import BranchesMgr.entity.Branches; public class BrancheseServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=utf-8"); PrintWriter out = response.getWriter(); //查询出所有网点信息 BranchesDao branchdao=new BranchesDaoImpl(); List<Branches>blist=branchdao.getBranches(); request.setAttribute("blist", blist); request.getRequestDispatcher("index.jsp").forward(request, response); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }