1. simple comparison
Request. getparameter is more familiar than parameter.
Request. getparametervalues (string name) is used to obtain data such as the checkbox class (with the same name but multiple values. Receives array variables, such as the checkobx type.
Request. getparameter (string name) is used to obtain the data of the corresponding name. If there are repeated names, the first value is returned. It receives common variables, such as the text type.
Example:
1. Three text labels with the same name
<Input type = "text" name = "test" value = "1"/>
<Input type = "text" name = "test" value = "2"/>
<Input type = "text" name = "test" value = "3"/>
Request. getparametervalues ("test") --------------- [1, 2, 3]
Request. getparameter ("test") ------------------ 1
$ {Paramvalues. Test}
$ {Param. Test}
2. checkbox
<Input type = "checkbox" name = "habit" value = "read"> reading
<Input type = "checkbox" name = "habit" value = "movie"> movie
<Input type = "checkbox" name = "habit" value = "game"> games
Request. getparametervalues ("habit ")
Ii. Related Topics ------ hidden objects
1. jsp implicit object (implicit object)
Implicit objects refer to objects that can be directly used without any declaration when writing JSP pages. Jsp2.0 defines nine implicit objects
Request Response pagecontext session application out conifg page exception
Here we only mention two objects: request and response.
The request object indicates the content of the client request. For example, we have obtained the user input content from the request and implemented the javax. servlet. http. httpservletrequest interface.
The response object indicates the response result of the client.
The above two methods of request are used: getparameter and getparametervalues. In fact, there are several other methods that are more important than response. Here, only a few methods are involved to get the number of response requests.
String getparameter (string name) obtains the parameter value of name.
String [] getparametervalues (string name) gets the struct value of all names
Enumeration getparameternames () to obtain the names of all workers
Map <string, string []> getparametermap () gets a ing of the total number of workers in the request
//
Returns a java. util. Map of the parameters of this request. Request Parameters are extra information sent with the request. For HTTP Servlets, parameters are contained in the query string or posted form data.
Returns:
An Immutable Java. util. map containing parameter names as keys and parameter values as map values. the keys in the parameter map are of Type string. the values in the parameter map are of Type string array.
//
Response and other hidden objects also have important identities. They have the opportunity to sort out and publicize their prominent position.
2. El implicit object
El is the experssion language. Since jsp2.0, it has become one of the JSP standard specifications. The serviner that supports servlet2.4/jsp2.0 also supports El syntax.
A common form is as follows: <C: Out value = "$ {3 + 7*4}"/>
The hidden object of El has 11 pagecontext pageconrequestscope sessionscope applicationscope
Param paramvalues header headervalues cookie initparam
In this example, Param and paramvalues correspond to servletrequest. getparameter (string name) and servletrequest. getparametervalues (string name)
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/moreorless/archive/2009/05/18/4199677.aspx