JAX-RS is an annotation-driven Java API that can be used for exposing Java beans as HTTP based services. For example, RESTful web applications are developed using JAX-RS annotations to define the resources exposed by the service. Web applications developed using JAX-RS annotations consist of the following qualities:
- Use of HTTP/S transport protocols for message transfer.
- The content that is transported by a JAX-RS web service can be in any format, e.g., XML, JSON, TEXT etc.
- Security can be enabled for a JAX-RS web application either at the HTTP Header level, or by using TLS protocol.
Info |
---|
Use WSO2 Developer Studio to easily develop your JAX-WS/JAX-RS Application. It will generate the needed Web application structure and you only have to concentrate on annotations and the business logic. |
See the following topics for information on JAX-RS applications in WSO2 AS:
Table of Contents | ||||
---|---|---|---|---|
|
...
JAX-RS annotations are defined in JSR 311. They are also a way of mapping Java with HTTP requests. For example, @GET, @PUT, @POST, @DELETE and @HEAD are JAX-RS annotations that directly map to HTTP requests by the same name. See the official Java documentation, for details about JAX-RS annotations and RESTful web services.
Shown below is an example of a simple web application that uses the following JAX-RS annotations: @Path, @GET, @Consumes and @Produces.
...