/** * * Returns the name of the HTTP method with which this * request was made, for example, GET, POST, or PUT. * Same as the value of the CGI variable REQUEST_METHOD. * * @return a <code>String</code> * specifying the name * of the method with which * this request was made * */
public String getMethod();
String method = request.getMethod(); if ("GET".equals(method)) {
*
* Returns the name of the HTTP method with which this
* request was made, for example, GET, POST, or PUT.
* Same as the value of the CGI variable REQUEST_METHOD.
*
* @return a <code>String</code>
* specifying the name
* of the method with which
* this request was made
*
*/
public String getMethod();
String method = request.getMethod();
if ("GET".equals(method)) {
} else if ("POST".equals(method)) {
}