国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JSP > 正文

JSP之表單提交get和post的區別詳解及實例

2024-09-05 00:23:25
字體:
來源:轉載
供稿:網友

JSP之表單提交get和post的詳解及實例

一 get和post的區別

JSP,get,post,表單提交

二 實戰(post方式提交)

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" >    <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" >    -->  </head>  <body>  <h1>用戶登錄</h1>  <hr>  <form action="dologin.jsp" name="loginForm" 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" >    <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" >    -->  </head>  <body>  <h1>登錄成功</h1>  <hr> </body></html>

 三 運行結果

JSP,get,post,表單提交

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


注:相關教程知識閱讀請移步到JSP教程頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 南部县| 白水县| 万州区| 舞阳县| 嘉荫县| 隆林| 台南县| 会宁县| 平凉市| 巴彦县| 甘洛县| 新丰县| 贵定县| 怀仁县| 万安县| 广汉市| 彭州市| 从江县| 辉县市| 涿州市| 惠水县| 牡丹江市| 高台县| 太仓市| 固始县| 万山特区| 石家庄市| 巴里| 怀集县| 肃宁县| 奉新县| 浙江省| 绥芬河市| 锡林郭勒盟| 江达县| 泗水县| 山阴县| 海伦市| 湘潭市| 惠东县| 休宁县|