• request.getParameter(“xxx”)的参数的取值


    request.getParameter(“xxx”)的参数的取值

    request.getParameter(“xxx”)的参数的取值的几种可能:

    1. Html中form表单中标签的name属性:

    <form name="form" method="post" action="checkUser">  

    请输入用户姓名:<input type="text" name="username">  

    <input type="submit" name="Submit" value="提交">  

    </form>  

    request.getParameter(“username”);

    2. Html中form表单提交时的action的参数

    <form name="form" method="post" action="checkUser?Flag=1&Id=2">  

    请输入用户姓名:<input type="text" name="username">  

    <input type="submit" name="Submit" value="提交">  

    </form> 

    request.getParameter(“username”);

    request.getParameter(“Flag”);

    request.getParameter(“Id”);

    3. Html中url的内容

    <a href="SortServlet?flag=5&temp=2" οnclick="sort()"><img src="images/cbsj.jpg" /></a>

    request.getParameter(“flag”);

    request.getParameter(“temp”);

    4. Ajax中的data

    <form name="fm" action="" method="post">

    <div style="margin-bottom:10px;">

    <input class="TxtUserNameCssClass" type="text" id="UserCode" value="" />

    </div>

    <div style="margin-top:20px;">

    <input class="TxtPasswordCssClass" type="Password" id="UserPwd" value="" />

    </div>

    </form>

    <div class="IbtnEnterCssClass" id="IbtnEnter" οnclick="submitForm()">登录</div>

    function submitForm(){

    var UserCode = $("#UserCode").val();

    var UserPwd = $("#UserPwd").val();

    var mypwd = $.base64.btoa($.md5(UserPwd).toUpperCase());

    var checkUserParams = {

    usercode:UserCode,

    userpwd:mypwd

    };

    $.ajax({

    url : 'checkUser.asp?mathid='+Math.random(),

    type : 'post',

    data : checkUserParams,

    dataType:'json',//接受数据格式

    success : function(data) {

    },

    failure : function(data) {

    }

    });

    }

    request.getParameter("usercode");

    request.getParameter("userpwd");

     只为学习!!!

    转载原路径   https://blog.csdn.net/BIRD_A_JAVA/article/details/80367805

  • 相关阅读:
    Discourse 的信任级别
    相同主机上提供不同web server的nginx配置和试验记录
    17APIGateway微服务网关
    16限流熔断降级
    121gRPC重试与接口幂等性
    logback配置!
    Javascript IE8下parseInt()方法的取值异常 harara
    nginx入门指南 harara
    基于docker部署实现接口自动化持续集成
    flex spacebetween 均分换行,不够一行的时候从左侧开始
  • 原文地址:https://www.cnblogs.com/chaoesha/p/13041381.html
Copyright © 2020-2023  润新知