亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術(shù)文章
文章詳情頁

JSP中param動作的實(shí)例詳解

瀏覽:171日期:2022-06-07 10:25:55

JSP中param動作的實(shí)例詳解

一 語法

<jsp:param name="參數(shù)名" value="參數(shù)值">

常常與<jsp:forward>一起使用,作為其子標(biāo)簽存在。

二 代碼

1、login.jsp

<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" %><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head>  <base href="<%=basePath%>" rel="external nofollow" rel="external nofollow" rel="external nofollow" >    <title>My JSP "login.jsp" starting page</title>      <meta http-equiv="pragma" content="no-cache">    <meta http-equiv="cache-control" content="no-cache">    <meta http-equiv="expires" content="0">      <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">    <meta http-equiv="description" content="This is my page">    <!--    <link rel="stylesheet" type="text/css" href="styles.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" >    -->  </head>  <body>  <h1>系統(tǒng)登錄</h1>  <hr>  <form name="loginForm" action="dologin.jsp" method="post">   <table>    <tr>     <td>用戶名:</td>     <td><input type="text" name="username"/></td>    </tr>    <tr>     <td>密碼:</td>     <td><input type="password" name="password"/></td>    </tr>    <tr>     <td colspan="2"><input type="submit" value="登錄"/></td>    </tr>   </table>  </form> </body></html>

2、dologin.jsp

<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head>  <base href="<%=basePath%>" rel="external nofollow" rel="external nofollow" rel="external nofollow" >    <title>My JSP "dologin.jsp" starting page</title>      <meta http-equiv="pragma" content="no-cache">    <meta http-equiv="cache-control" content="no-cache">    <meta http-equiv="expires" content="0">      <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">    <meta http-equiv="description" content="This is my page">    <!--    <link rel="stylesheet" type="text/css" href="styles.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" >    -->  </head>  <body>  <jsp:forward page="user.jsp">   <jsp:param value="admin@123.net" name="email"/>   <jsp:param value="888888" name="password"/>  </jsp:forward> </body></html>

3、user.jsp

<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%><%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head>  <base href="<%=basePath%>" rel="external nofollow" rel="external nofollow" rel="external nofollow" >    <title>My JSP "user.jsp" starting page</title>      <meta http-equiv="pragma" content="no-cache">    <meta http-equiv="cache-control" content="no-cache">    <meta http-equiv="expires" content="0">      <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">    <meta http-equiv="description" content="This is my page">    <!--    <link rel="stylesheet" type="text/css" href="styles.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" >    -->  </head>  <body>  <h1>用戶資料</h1>  <hr>  <%    request.setCharacterEncoding("utf-8");    String username = "";    String password = "";    String email = "";    if(request.getParameter("username")!=null)    {     username = request.getParameter("username");    }    if(request.getParameter("password")!=null)    {     password = request.getParameter("password");    }    if(request.getParameter("email")!=null)    {     email = request.getParameter("email");    }     %>    用戶名:<%=username %><br>    密碼:<%=password %><br>    電子郵箱:<%=email %><br> </body></html> 

三 運(yùn)行結(jié)果

如有疑問請留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!

標(biāo)簽: JSP
主站蜘蛛池模板: 亚洲国产精品久久久久秋霞66 | 亚洲国产婷婷俺也色综合 | 欧美久久精品 | 三级中文字幕永久在线视频 | 看一级特黄a大片日本片黑人 | 亚洲精品自产拍在线观看 | 国产一区二区视频在线播放 | 欧美高清一级片 | 妞干网手机免费视频 | 日本一级毛片视频无遮挡免费 | 国内精品久久影视免费 | 国产精品女同一区二区久久夜 | 国产精品久久久久三级 | 999yy成年在线视频免费看 | 国产草比 | 国产精品亚洲精品 | 99久久国产综合精品2020 | 亚洲全网成人资源在线观看 | 综合久久久久综合体桃花网 | 国产性高清在线观看 | 道日本一本草久 | 亚洲欧美综合另类 | 91啦中文成人 | 久久国产高清字幕中文 | 精品一区视频 | 美国一级特a黄 | 国产精品人人爱一区二区白浆 | 白丝美女啪啪 | 国产精品欧美一区二区三区不卡 | 免费看真人a一级毛片 | 免费人成黄页在线观看忧物 | 49pao强力免费打造在线高清 | 久久久久一区二区三区 | 中国国产一级毛片 | 91成人在线免费视频 | 欧美一级片免费 | 国产草草影院ccyycom软件 | 国产视频二 | 香蕉视频91| 欧美日韩亚洲国内综合网香蕉 | 98香蕉草草视频在线精品看 |