/ / Où les paramètres sont-ils stockés dans l'objet de requête? - java, http, débogage, servlets, demande

Où les paramètres sont-ils stockés dans l'objet de requête? - java, http, débogage, servlets, demande

J'ai la ligne de code suivante

request.getParameter("email");

lors du débogage lorsque j'inspecte cette ligne, j'obtiens la valeur souhaitée, mais lorsque j'inspecte l'ensemble demande objet je ne peux pas voir cette valeur dans mon ParameterMap.

Où trouver ces valeurs dans l'objet de requête

J'utilise tomcat 6.0.34 comme conteneur

Réponses:

0 pour la réponse № 1
Request parameters are extra information sent with the request.
For HTTP servlets, parameters are contained in the query string or posted form data. If the parameter data was sent in the request body, then i occurs with an HTTP POST request.

Dans une requête HTTP GET, les paramètres sont envoyés sous forme de chaîne de requête:

http://example.com/page?parameter=value&also=another

vérifier cela pour plus d'informations

Data from the query string and the post body are aggregated into the request parameter set. Query string data is presented BEFORE post body data. For example, if a request is made with a query string of a=hello and a post body of a=goodbye&a=world, the resulting parameter set would be ordered a=(hello, goodbye, world).

The following are the conditions that must be met before post FORM data will be populated to the parameter set:

The request is an HTTP or HTTPS request.

The HTTP method is POST.

The content type is application/x-www-form-urlencoded.

The servlet has made an initial call of any of the "getParameter" family of methods on the request object.

If the conditions are not met and the post form data is not included in the parameter set, the post data must still be available to the servlet via the request object"s input stream. If the conditions are met, post form data will no longer be available for reading directly from the request object"s input stream.

http://www.javacertifications.net/javacert/HttpservletRequest.jsp

http://www.w3.org/TR/html401/interact/forms.html#h-17.13

http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/ServletRequest.html#getParameter(java.lang.String)

http://www.xyzws.com/Servletfaq/what-is-the-difference-between-the-request-attribute-and-request-parameter/1