zoukankan      html  css  js  c++  java
  • 013_request对象包含的内容以及获取

    例子:

    做一个用户登录系统:

    1、新建一个login.jsp,写form表单

    2、做2个页面ok.jsp (成功),error.jsp(错误)

    3、新建一个Servlet接收request,并取得username和password

    String username = request.getParameter("userName");

            String password = request.getParameter("password");

            System.out.println(username+"  "+ password);

            //模拟管理员是admin,密码是123456

            if (  username.equals("admin") & password.equals("123456") ){

                //代表登录成功,跳转到成功页面去

                response.sendRedirect("ok.jsp");

            }

            else{

                //不符合条件就是登录失败,跳转到失败页面

                response.sendRedirect("error.jsp");

            }

  • 相关阅读:
    centos7安装elasticsearch
    nginx安装
    Emit学习笔记
    Docker备忘录
    IdentityServer4-参考
    IdentityServer4-端点
    IdentityServer4-主题
    css
    IdentityServer4-快速入门
    IdentityServer4-介绍
  • 原文地址:https://www.cnblogs.com/wyj1212/p/9000846.html
Copyright © 2011-2022 走看看