首页 > Web开发 > 详细

JSP 04课 (1)

时间:2020-03-28 19:33:17      阅读:43      评论:0      收藏:0      [点我收藏+]

技术分享图片

技术分享图片

<%@ page language="java" import="java.util.*" pageEncoding="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%>">
    
    <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">
    -->

  </head>
  
  <body>
  <form action="display.jsp" method="post" name="muform">
  <table border="0" cellpadding="0" cellspacing="0" align="center" width="600px">
 <tr>
    <td height="108" colspan="2"><img src="images/top.jpg"></td>
  </tr>
  <tr>
  <td width="195px" height="35px">用户名:</td>
  <td width="510px"><input type="text" name="tUser"></td>
  </tr>
  <tr>
  <td width="195px" height="35px">密码:</td>
  <td width="510px"><input type="password" name="tPwd"></td>
  </tr>
  <tr>
  <td width="195px" height="35px">确认密码:</td>
  <td width="510px"><input type="password" name="tRwd"></td>
  </tr>
  <tr>
  <td width="195px" height="35px">性别:</td>
  <td width="510px">
  <input type="radio" name="s" value="" checked>男&nbsp;&nbsp;
  <input type="radio" name="s" value="" class="input"></tr>
  <tr>
  <td width="195px" height="35px">email:</td>
  <td width="510px"><input type="text" name="tEm">
  </td>
  </tr>
  <tr>
  <td width="195px" height="35px">出生年月:</td>
  <td width="510px"><input name="year" id="year" size="5" maxlength="5">&nbsp;年&nbsp;&nbsp;
  <select name="month">
  <option value=1>一月</option>
  <option value=2>二月</option>
  <option value=3>三月</option>
  <option value=4>三月</option>
  <option value=5>三月</option>
  <option value=6>三月</option>
  <option value=7>三月</option>
  <option value=8>三月</option>
  <option value=9>三月</option>
  <option value=10>三月</option>
  <option value=11>三月</option>
  <option value=12>三月</option>
  </select>&nbsp;月&nbsp;&nbsp;
  <select name="day">
  <option value=1>1</option>
  <option value=2>2</option>
  <option value=3>3</option>
  <option value=4>4</option>
  <option value=5>5</option>
  <option value=6>6</option>
  <option value=7>7</option>
  <option value=8>8</option>
  <option value=9>9</option>
  <option value=10>10</option>
  <option value=11>11</option>
  <option value=12>12</option>
  <option value=13>13</option>
  <option value=14>14</option>
  <option value=15>15</option>
  <option value=16>16</option>
  <option value=7>17</option>
  <option value=18>18</option>
  <option value=19>19</option>
  <option value=20>20</option>
  <option value=21>21</option>
  <option value=22>22</option>
  <option value=23>23</option>
  <option value=24>24</option>
  <option value=25>24</option>
  <option value=26>26</option>
  <option value=27>27</option>
  <option value=28>28</option>
  <option value=29>29</option>
  <option value=30>30</option>
  <option value=31>31</option>
  </select>&nbsp;日
  </td>
  </tr>
  <TR><TD colspan="2" align="center">
  <br>
  <INPUT type="submit" value="提交">
  </TD></TR>
  </table>
 </form>
  </body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="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%>">
    
    <title>My JSP display.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">
    -->

  </head>
  
  <body>
  <div align="center">
  <img src="images/top2.jpg">
  </div>
  <div align="center">
  <h1>信息显示</h1>
  <%
  request.setCharacterEncoding("utf-8");
  String name=request.getParameter("tUser");
  String password=request.getParameter("tPwd");
  String sex=request.getParameter("s");
  String email=request.getParameter("tEm");
  String y=request.getParameter("year");
  String m=request.getParameter("month");
  String d=request.getParameter("day");
   %>
   用户名是:<%=name%><br>
   密码是:<%=password %><br>
   性别是:<%=sex %><br>
   电子邮件地址是:<%=email %><br>
   出生日期是:<%=y %>年<%=m %>月<%=d %></div>
  </body>
</html>

 

JSP 04课 (1)

原文:https://www.cnblogs.com/naoguakerteng/p/12588863.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!