zoukankan      html  css  js  c++  java
  • android 学习

    servlet层

    package servlet;
    import java.util.List;
    import java.io.IOException;
    
    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.Dao;
    
    import Bean.Diqu;
    import Bean.Sheng;
    
    
    @WebServlet("/Servlet")
    public class Servlet extends HttpServlet {
        private static final long serialVersionUID = 1L;
           
        
        public Servlet() {
            super();
            
        }
        protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
            req.setCharacterEncoding("utf-8");
            String method = req.getParameter("method");
            if ("tcha".equals(method)) {
                tcha(req,resp);
            }
        }   
        private void tcha(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException{
            String []m=new String[34];
            req.setCharacterEncoding("utf-8");
            Dao dao =new Dao();
            HttpSession session = req.getSession();
            String time = (req.getParameter("time"));
            String locate= (req.getParameter("locate"));
            List<Diqu> holds = dao.tcha(time,locate);
            List<Sheng> holds1 = dao.Scha(time);
            for(int i = 0; i < holds1.size(); i++){
                Sheng d=holds1.get(i);
                m[i]=d.getPerson();
            }
            System.out.println(m[0]);
            req.setAttribute("m", m);
            req.setAttribute("holds", holds);
            req.getRequestDispatcher("index.jsp").forward(req,resp);
    }
    }
  • 相关阅读:
    memcache概念浅谈及名称混乱之区分
    apache设置头
    Apache中关于页面缓存的设置
    memcahced&redis命令行cmd下的操作
    memcache命令行
    Memcached管理与监控
    memcache stats命令详解
    memcache基础知识-stats参数
    ab测试
    yum安装Apache,Mysql,PHP
  • 原文地址:https://www.cnblogs.com/Nojava/p/14908281.html
Copyright © 2011-2022 走看看