Request Object
The request object is used to handle the parameters of the request in HTTP, and the most common is to get the requested parameters. If you want to specify multiple parameters at the same time, the use of the parameters between the (&) is delimited
Example gets the passed parameter value code by using the GetParameter () method of the request object as follows
The index page is used to connect to the delta
<%@ page language= "java" contenttype= "text/html; charset=gb18030 "pageencoding=" GB18030 "%>
<meta http-equiv= "Content-type" content= "text/html; charset=gb18030 ">
<title> use the Request object to get the requested parameter value </title>
<body>
<a href= "deal.jsp?id=1&user=" > Processing page </a>
<--This specifies the parameter name and value for the ID, and the user specifies that the character parameter name does not specify the argument value--
</body>
Note: When the request's GetParameter method gets the passed argument, if the specified argument does not exist, NULL is returned, the parameter name is specified but no argument is specified, and an empty string "" is returned.
Delete Page
<%@ page language= "java" contenttype= "text/html; charset=gb18030 "pageencoding=" Utf-8 "%>
<%
String id=request.getparameter ("id");//Gets the value of the ID parameter
String user=request.getparameter ("user");//Gets the value of the user parameter
String pwd=request.getparameter ("pwd");//get pwd parameter value
%>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<title> Processing Pages </title>
<body>
The value of the ID parameter is: <%=id%><br>
The value of the user parameter is: <%=user%><br>
The value of the PWD parameter is: <%=pwd%>
</body>
JAVA Web Request Object