• 3.4.2访问(获取)请求参数


    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <body>
    <form action="2.jsp"method="post">
    姓名:<input type="text"name="RdName"><br>
    密码:<input type="password"name="RdPasswd"><br><br>
    <input type="submit"value="确定">
    </form>
    </body>

    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <body>
    <%request.setCharacterEncoding("utf-8");
    String Name=request.getParameter("RdName");
    String Passwd=request.getParameter("RdPasswd");
    if(Name.equals("zhangjuan ")&&Passwd.equals("3152052051439")){%>
    <jsp:forward page="3.jsp"/>
    <%}else{%>
    <jsp:forward page="4.jsp"/>
    <%} %>
    </body>

    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

    <body>
    <% String Name=request.getParameter("RdName");%>
    欢迎<%=Name%>成功登录!
    </body>

    <%@ page language="java" import="java.util.*" pageEncoding="Utf-8"%>
    <html>
    <head><title>登录出错</title></head>
    <body>
    <h4>用户名或密码错误,请重新登录</h4>
    <a href="1.jsp">重新登录</a>
    <hr width="100%" size="2"color="green">
    </body>
    </html>

    
    
    
    
  • 相关阅读:
    markdown with vim
    递归
    类 sizeof
    cppcheck工具
    c++ explicit的含义和用法
    pca主成分分析
    string的使用
    linux的shell进化简史
    adb shell 无法启动 (insufficient permissions for device)
    c++ 四种转换的意思
  • 原文地址:https://www.cnblogs.com/htmll/p/7615854.html
Copyright © 2020-2023  润新知