javax.ws.rs
Annotation Type HttpMethod
@Target(value=ANNOTATION_TYPE)
@Retention(value=RUNTIME)
@Documented
public @interface HttpMethod
Associates the name of a HTTP method with an annotation. A Java method annotated
with a runtime annotation that is itself annotated with this annotation will
be used to handle HTTP requests of the indicated HTTP method.
Such Java methods must satisfy the following constraints:
- Methods must have a return type of
void
,
Response
or T
. Return values will be serialized
in the HTTP response. A Response
return allows the application
to supply additional metadata that will accompany the response entity.
- Methods may have a single optional parameter
that is not annotated. The parameter provides access to
the contents of the HTTP request entity body. The parameter will be null if
the HTTP request entity body is of zero length.
- Methods may have zero or more additional method arguments, each of which
must be annotated with either
PathParam
,
HeaderParam
, CookieParam
,
MatrixParam
, QueryParam
or
Context
- See Also:
GET
,
POST
,
PUT
,
DELETE
,
HEAD
,
Context
,
PathParam
,
QueryParam
,
MatrixParam
,
HeaderParam
,
CookieParam
Required Element Summary |
java.lang.String |
value
Specifies the name of a HTTP method. |
value
public abstract java.lang.String value
- Specifies the name of a HTTP method. E.g. "GET".
Copyright © 2008. All Rights Reserved.