<%@ 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>男 <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"> 年 <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> 月 <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> 日 </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>
原文:https://www.cnblogs.com/naoguakerteng/p/12588863.html