Skip to content

Instantly share code, notes, and snippets.

@podisto
Forked from arnabmitra/Jaxrs vs Spring boot
Created May 13, 2018 10:24
Show Gist options
  • Select an option

  • Save podisto/c25425e808b9bcacafc84df9e810d8d7 to your computer and use it in GitHub Desktop.

Select an option

Save podisto/c25425e808b9bcacafc84df9e810d8d7 to your computer and use it in GitHub Desktop.
Spring to JAX-RS Cheat Sheet
This is not an exhaustive list, but it does include the most common annotations.
Spring Annotation JAX-RS Annotation
@RequestMapping(path = "/troopers" @Path("/troopers")
@RequestMapping(method = RequestMethod.POST) @POST
@RequestMapping(method = RequestMethod.GET) @GET
@RequestMapping(method = RequestMethod.DELETE) @DELETE
@ResponseBody N/A
@RequestBody N/A
@PathVariable("id") @PathParam("id")
@RequestParam("xyz") @QueryParam('xyz")
@RequestParam(value="xyz" @FormParam(“xyz”)
@RequestMapping(produces = {"application/json"}) @Produces("application/json")
@RequestMapping(consumes = {"application/json"}) @Consumes("application/json")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment