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

您的位置:首頁技術文章
文章詳情頁

JSP中param動作的實例詳解

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

JSP中param動作的實例詳解

一 語法

<jsp:param name="參數名" value="參數值">

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

二 代碼

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>系統登錄</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> 

三 運行結果

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

標簽: JSP
主站蜘蛛池模板: 欧美日韩综合网在线观看 | 欧美三级视频在线播放 | 中国一级特黄高清免费的大片 | 亚洲视频免费在线播放 | 成人免费体验区福利云点播 | 毛片网在线 | 国产精品视频一区二区三区w | 色天天综合网色鬼综合 | 日日摸夜夜摸人人嗷嗷叫 | 外国一级黄色毛片 | 日本一极毛片兔费看 | 一级aaa级毛片午夜在线播放 | 午夜a视频 | 日韩大片观看网址 | 欧美黑寡妇香蕉视频 | 张柏芝国产www | 国产精品一在线观看 | 免费大黄网站在线观看 | 久久精品国产福利国产琪琪 | 国产一二精品 | 国产永久免费视频m3u8 | 一区二区中文字幕在线观看 | 欧美变态口味重另类日韩毛片 | 夜鲁鲁鲁夜夜综合视频欧美 | 久久视频在线观看免费 | 拍拍拍拍拍拍拍无挡大全免费 | 久久成人在线 | 深夜做爰性大片很黄很色视频 | 国产制服丝袜在线 | 国产成人一区在线播放 | 久久91精品国产91久久跳舞 | 9966久久精品免费看国产 | 久久国产精品亚洲综合 | 欧美日韩在线视频 | 亚洲国产高清在线精品一区 | 亚洲精品永久一区 | 日本人爽p大片免费看 | 国产在线精彩视频二区 | 亚洲精品αv一区二区三区 亚洲精品不卡 | 老妇毛片久久久久久久久 | 香蕉久久高清国产精品免费 |