@Path("widgets/{widgetid}")
@Consumes("application/widgets+xml")
@Produces("application/widgets+xml")
public class WidgetResource {
@GET
public String getWidget(@PathParam("widgetid") String id) {
return getWidgetAsXml(id);
}
@PUT
public void updateWidget(@PathParam("widgetid") String id,
Source update) {
updateWidgetFromXml(id, update);
}
...
}
| Modifier and Type | Annotation and Description |
|---|---|
| public @interface | ApplicationPath
Identifies the application path that serves as the base URI
for all resource URIs provided by |
| public @interface | BeanParam
The annotation that may be used to inject custom JAX-RS "parameter aggregator" value object into a resource class field, property or resource method parameter. |
| public @interface | ConstrainedTo
Indicates the run-time context in which an annotated JAX-RS provider is applicable. |
| public @interface | Consumes
Defines the media types that the methods of a resource class or
|
| public @interface | CookieParam
Binds the value of a HTTP cookie to a resource method parameter, resource class field, or resource class bean property. |
| public @interface | DefaultValue
Defines the default value of request meta-data that is bound using one of the
following annotations:
|
| public @interface | DELETE
Indicates that the annotated method responds to HTTP DELETE requests. |
| public @interface | Encoded
Disables automatic decoding of parameter values bound using |
| public @interface | FormParam
Binds the value(s) of a form parameter contained within a request entity body to a resource method parameter. |
| public @interface | GET
Indicates that the annotated method responds to HTTP GET requests. |
| public @interface | HEAD
Indicates that the annotated method responds to HTTP HEAD requests. |
| public @interface | HeaderParam
Binds the value(s) of a HTTP header to a resource method parameter, resource class field, or resource class bean property. |
| public @interface | HttpMethod
Associates the name of a HTTP method with an annotation. |
| public @interface | MatrixParam
Binds the value(s) of a URI matrix parameter to a resource method parameter, resource class field, or resource class bean property. |
| public @interface | NameBinding
Meta-annotation used to create name binding annotations for filters and interceptors. |
| public @interface | OPTIONS
Indicates that the annotated method responds to HTTP OPTIONS requests. |
| public @interface | PATCH
Indicates that the annotated method responds to HTTP PATCH requests. |
| public @interface | Path
Identifies the URI path that a resource class or class method will serve requests for. |
| public @interface | PathParam
Binds the value of a URI template parameter or a path segment containing the template parameter to a resource method parameter, resource class field, or resource class bean property. |
| public @interface | POST
Indicates that the annotated method responds to HTTP POST requests. |
| public @interface | Produces
Defines the media type(s) that the methods of a resource class or
|
| public @interface | PUT
Indicates that the annotated method responds to HTTP PUT requests. |
| public @interface | QueryParam
Binds the value(s) of a HTTP query parameter to a resource method parameter, resource class field, or resource class bean property. |
| Modifier and Type | Class and Description |
|---|---|
| public class | BadRequestException
A runtime exception indicating a |
| public class | ClientErrorException
A base runtime application exception indicating a client request error
(HTTP |
| public class | ForbiddenException
A runtime exception indicating that an access to a resource requested by
a client has been |
| public class | InternalServerErrorException
A runtime exception indicating an |
| public class | NotAcceptableException
A runtime exception indicating that a client request is
|
| public class | NotAllowedException
A runtime exception indicating a client requesting a resource method that is
|
| public class | NotAuthorizedException
A runtime exception indicating request authorization failure caused by one of the following scenarios:
|
| public class | NotFoundException
A runtime exception indicating a resource requested by a client was
|
| public class | NotSupportedException
A runtime exception indicating that the client request entity media type is
|
| public class | Priorities
A collection of built-in priority constants for the JAX-RS components that are supposed to be
ordered based on their |
| public class | ProcessingException
A base JAX-RS runtime processing exception. |
| public class | RedirectionException
A runtime application exception indicating a request redirection
(HTTP |
| public class | ServerErrorException
A base runtime application exception indicating a server error
(HTTP |
| public class | ServiceUnavailableException
A runtime exception indicating that the requested resource
|
| public class | WebApplicationException
Runtime exception for applications. |
| Modifier and Type | Enum and Description |
|---|---|
| public enum | RuntimeType
Enumeration of JAX-RS runtime types. |