zoukankan      html  css  js  c++  java
  • 毕业设计-1.16

    情况概述:

      今天复习了可视化的内容,关于echarts以及图表的展示。对servlet的编写。

    代码如下:

    package com.zlc.servlet;
    
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.List;
    
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    import com.zlc.dao.IWeatherDao;
    import com.zlc.dao.impl.WeatherDaoImpl;
    import com.zlc.entity.WeatherBean;
    import com.zlc.service.IWeatherService;
    import com.zlc.service.impl.WeatherServiceImpl;
    
    /**
     * @author Zhao Lucang
     * @version 创建时间:2021年2月26日 下午10:31:02 类说明
     */
    public class WeatherSearch01 extends HttpServlet {
    
        /**
         * Constructor of the object.
         */
        public WeatherSearch01() {
            super();
        }
    
        /**
         * Destruction of the servlet. <br>
         */
        public void destroy() {
            super.destroy(); // Just puts "destroy" string in log
            // Put your code here
        }
    
        /**
         * The doGet method of the servlet. <br>
         *
         * This method is called when a form has its tag value method equals to get.
         * 
         * @param request  the request send by the client to the server
         * @param response the response send by the server to the client
         * @throws ServletException if an error occurred
         * @throws IOException      if an error occurred
         */
        public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    
            // 定义接收编码
            request.setCharacterEncoding("UTF-8");
            // 定义输出
            response.setContentType("text/html");
            response.setCharacterEncoding("utf-8");
            String City=request.getParameter("City");
            int Date=Integer.parseInt(request.getParameter("Date"));
            IWeatherService service = new WeatherServiceImpl();
            IWeatherDao dao = new WeatherDaoImpl();
            List<WeatherBean> weathers = new ArrayList<WeatherBean>();
            weathers = service.queryAllWeathersByCityDate(City, Date);
            request.setAttribute("weathers", weathers);
            request.getRequestDispatcher("../Demo01.jsp").forward(request, response);
            //response.sendRedirect("../Demo02.jsp");
        }
    
        /**
         * The doPost method of the servlet. <br>
         *
         * This method is called when a form has its tag value method equals to post.
         * 
         * @param request  the request send by the client to the server
         * @param response the response send by the server to the client
         * @throws ServletException if an error occurred
         * @throws IOException      if an error occurred
         */
        public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    
            doGet(request, response);
        }
    
        /**
         * Initialization of the servlet. <br>
         *
         * @throws ServletException if an error occurs
         */
        public void init() throws ServletException {
            // Put your code here
        }
    
    }
  • 相关阅读:
    TF-IDF
    3.路径模板两张表设计
    6.订单支付回调接口
    5.创建订单并生成支付链接接口
    5.使用ES代替whoosh全文检索
    4.docker基本使用
    3.ubuntu安装docker
    2.课程全文检索接口
    1.搜索引擎工作原理
    7.视频播放页面接口开发
  • 原文地址:https://www.cnblogs.com/zlc364624/p/14461049.html
Copyright © 2011-2022 走看看