银行营业网点管理系统——Servlet包(CityAreaServlet )
生活随笔
收集整理的這篇文章主要介紹了
银行营业网点管理系统——Servlet包(CityAreaServlet )
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
package BranchesMgr.servlet;
/*** 城區(qū)表的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.CityAreaDao;
import BranchesMgr.dao.impl.CityAreaDaoImpl;
import BranchesMgr.entity.CityArea;public class CityAreaServlet extends HttpServlet {CityAreaDao citydao=new CityAreaDaoImpl();public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {response.setContentType("text/html;charset=utf-8");PrintWriter out = response.getWriter();request.setCharacterEncoding("utf-8");String cityname=request.getParameter("cityname");//查詢所有的城區(qū)getAllCity(request,response);request.setAttribute("cityname", cityname);request.getRequestDispatcher("updateBreaches.jsp").forward(request, response);}//查詢所有private void getAllCity(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException{PrintWriter out = response.getWriter();List<CityArea>clist=citydao.getCityArea();request.setAttribute("clist", clist);}public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {doGet(request, response);}}
轉(zhuǎn)載于:https://www.cnblogs.com/a1111/p/6540277.html
與50位技術(shù)專家面對面20年技術(shù)見證,附贈技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的银行营业网点管理系统——Servlet包(CityAreaServlet )的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: react-native 环境配置遇到的
- 下一篇: 人越过越麻木