Skip to content

Commit

Permalink
Add conversion table from Spring Web annotations to JAX-RS
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Nov 13, 2019
1 parent 3642c49 commit 89d1cac
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions docs/src/main/asciidoc/spring-web.adoc
Expand Up @@ -247,6 +247,54 @@ Spring classes and annotations are only used for reading metadata and / or are u
What that means for end users, is that adding arbitrary Spring libraries will not have any effect. Moreover Spring infrastructure
classes (like `org.springframework.beans.factory.config.BeanPostProcessor` for example) will not be executed.

== Conversion Table

The following table shows how Spring Web annotations can be converted to JAX-RS annotations.

|===
|Spring |JAX-RS |Comments

|@RequestController
|
|There is no equivalent in JAX-RS. Annotating a class with @Path suffices

|@RequestMapping(path="/api")
|@Path("/api")
|

|@RequestMapping(consumes="application/json")
|@Consumes("application/json")
|

|@RequestMapping(produces="application/json")
|@Produces("application/json")
|

|@RequestParam
|@QueryParam
|

|@PathVariable
|@PathParam
|

|@RequestBody
|
|No equivalent in JAX-RS. Method parameters corresponding to the body of the request are handled in JAX-RS without requiring any annotation

|@RestControllerAdvice
|
|No equivalent in JAX-RS

|@ResponseStatus
|
|No equivalent in JAX-RS

|@ExceptionHandler
|
|No equivalent annotation in JAX-RS. Exceptions are handled by implementing `javax.ws.rs.ext.ExceptionMapper`
|===

== More Spring guides

Quarkus support has more Spring compatibility features. See the following guides for more details:
Expand Down

0 comments on commit 89d1cac

Please sign in to comment.