• 每日日报2021.2.1


    今天完成内容:

    开发家庭小账本

    1.编写代码

    package com.edu.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 com.edu.dao.Userdao;
    import com.edu.entity.User;


    @WebServlet("/ResearchByName")
    public class ResearchByName extends HttpServlet {
    private static final long serialVersionUID = 1L;
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    request.getRequestDispatcher("utf-8");
    response.setCharacterEncoding("utf-8");
    String name = request.getParameter("username");
    Userdao dao = new Userdao();
    List<User> lists = dao.ResearchName(name);
    if(lists != null && lists.size()!=0) {
    System.out.println("查询成功!!!");
    request.setAttribute("list", lists);
    request.getRequestDispatcher("/Showname.jsp").forward(request, response);
    }
    else {
    System.out.println("查询失败!!!");
    request.getRequestDispatcher("/Showname.jsp").forward(request, response);
    }
    }


    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    doGet(request, response);
    }

    }

    查询代码

    遇到问题:

    明日目标:

    学习Android studio的开发

  • 相关阅读:
    Netty实现客户端和服务端通信简单例子
    上拉电阻的作用
    c语言常量指针赋值给变量指针导致警告
    修改ultisnips的默认键
    为debian8.2更换官方源
    linux下添加用户到sudo组
    用rfkill命令管理蓝牙和wifi
    用platformio编写arduino程序
    ubuntu下gcc-avr安装
    UNIX环境高级编程(第三版)关于apue.h的用法
  • 原文地址:https://www.cnblogs.com/leiyu1905/p/14905634.html
Copyright © 2020-2023  润新知