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

首頁 > 編程 > JSP > 正文

詳解JSP之表單提交get和post的操作步驟

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

get顧名思義是獲取的意思,而post意思是通過郵件發送,但實際上GET也可以傳輸數據,只是GET可以傳輸的數據量非常小,感興趣的朋友們可以跟著錯新技術頻道小編來學習詳解JSP之表單提交get和post的操作步驟吧!

詳解JSP之表單提交get和post的操作步驟

一 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的操作步驟,希望可以幫助到大家。還有什么問題的話,大家可以關注錯新技術頻道!

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 屏边| 桐庐县| 昭觉县| 昌黎县| 买车| 灵武市| 西昌市| 吴桥县| 泾源县| 合作市| 九江市| 龙泉市| 法库县| 七台河市| 德化县| 鹰潭市| 祁连县| 土默特右旗| 河津市| 天祝| 四川省| 通榆县| 怀远县| 麻栗坡县| 三明市| 邓州市| 乌恰县| 芮城县| 灵寿县| 汨罗市| 贵港市| 木里| 道孚县| 新化县| 大安市| 遵化市| 东明县| 克拉玛依市| 湖口县| 湖口县| 通河县|