Request获取ServletContext和登录案例_需求

Request获取ServletContext

ServletContext getServletContext()

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        ServletContext context = request.getServletContext();
        System.out.println(context);
    }

 

 之后的博客会仔细讲解

登录案例_需求

1.编写login.html登录页面

   username & password两个输入框

2.使用Druid数据库连接池技术,操作mysql, day14数据库中user表

3.使用JdbcTemplate技术封装JDBC

4.登录成功跳转到successservlet展示:登录成功!用户名,欢迎您

5.登录失败跳转到Failservlet展示:登录失败,用户名或密码错误

分析:

代码在下一个博客中

 

posted @ 2022-08-09 09:39  魔光领域  阅读(37)  评论(0编辑  收藏  举报