国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

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

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

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

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

一 語(yǔ)法

<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="[email protected]" 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ǐng)留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!

標(biāo)簽: JSP
主站蜘蛛池模板: 亚洲国产精品综合久久网络 | 麻豆69堂免费视频 | 国产欧美17694免费观看视频 | 亚洲视频在线免费看 | 996热在线视频 | 精品理论片一区二区三区 | 国产成人精品日本亚洲专一区 | 热er99久久6国产精品免费 | 亚洲精品久久久久综合91 | 操美女大逼视频 | 亚洲一区中文字幕在线 | 三级视频在线观看 | 在线观看亚洲国产 | 亚洲国产精品成人综合久久久 | 亚州一级片 | 欧美成人精品手机在线观看 | 一级一黄在线观看视频免费 | 手机在线观看亚洲国产精品 | 一色屋色费精品视频在线看 | 美女视频黄a视频免费全程 美女视频黄a视频免费全过程 | 嫩模大尺度人体福利视频 | 午夜成年 | 亚洲巨乳自拍在线视频 | 国产区一区二区三区 | 国产精品三 | 一区二区免费看 | 欧美日本免费观看αv片 | 男人的天堂免费视频 | 特大一级aaaaa毛片 | 欧美另类69xxxxx视频 | 亚洲三级在线观看 | 18videosex性欧美69 | 国产精品v免费视频 | 国产爽的冒白浆的视频高清 | 亚洲自偷自偷图片在线高清 | 美女午夜影院 | 欧美日韩精品国产一区二区 | 美女张腿男人桶免费视频 | 中文字幕一区二区在线观看 | 国产欧美久久久另类精品 | 最新国产精品亚洲 |