JSP - request - 1
1 <%@ page language="java" contentType="text/html;charset=utf8" %> 2 <%@ page import="java.util.*"%> 3 4 <html> 5 <title> 6 index page 7 </title> 8 <head> 9 <h1> 10 <center> 11 JAVA SCRIPT 12 </center> 13 </h1> 14 </head> 15 <body> 16 <% 17 request.setCharacterEncoding("utf8"); 18 %> 19 <center> 20 <table> 21 <form action="show.jsp" method="post"> 22 <tr> 23 <td> 24 name: 25 </td> 26 <td> 27 <input type="text" name="name" label="name"/> 28 </td> 29 </tr> 30 <tr> 31 <td> 32 gender: 33 </td> 34 <td> 35 <input type="text" name="gender" label="gender"/> 36 </td> 37 </tr> 38 39 <tr> 40 <td> 41 password: 42 </td> 43 <td> 44 <input type="password" name="passwd"> 45 </td> 46 </tr> 47 48 <tr> 49 <td> 50 <input type="submit"/> 51 </td> 52 <td> 53 <input type="reset"/> 54 </td> 55 </tr> 56 </form> 57 </table> 58 </center> 59 60 </body> 61 </html>
1 <%@ page language="java" contentType="text/html;charset=utf8" %> 2 <%@ page import="java.util.*"%> 3 <html> 4 <head> 5 6 </head> 7 8 <body> 9 <% 10 request.setCharacterEncoding("utf8"); 11 String username=request.getParameter("name"); 12 String gender=request.getParameter("gender"); 13 String password=request.getParameter("passwd"); 14 %> 15 16 <%=username %> </br> 17 <%=gender %> </br> 18 <%=password %> </br> 19 20 </body> 21 22 </html>