What is JAX-RS
Java API for RESTful Web Services (JAX-RS) is a Java
programming language API that provides support in creating web services
according to the Representational State Transfer (REST) architectural
pattern.
JAX-RS is an official part of Java EE 6.
JAX-RS is an official part of Java EE 6.
Annotations in JAX-RS
JAX-RS uses these annotations:
@Pathspecifies the relative path for a resource class or method.@GET,@PUT,@POST,@DELETEand@HEADspecify the HTTP request type of a resource.@Producesspecifies the response Internet media types (used for content negotiation).@Consumesspecifies the accepted request Internet media types.
@PathParambinds the method parameter to a path segment.@QueryParambinds the method parameter to the value of an HTTP query parameter.@MatrixParambinds the method parameter to the value of an HTTP matrix parameter.@HeaderParambinds the method parameter to an HTTP header value.@CookieParambinds the method parameter to a cookie value.@FormParambinds the method parameter to a form value.@DefaultValuespecifies a default value for the above bindings when the key is not found.@Contextreturns the entire context of the object (for example@Context HttpServletRequest request).
No comments:
Post a Comment