Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save roman4ello/52658e2252b279942ade40e970cd6a05 to your computer and use it in GitHub Desktop.
Save roman4ello/52658e2252b279942ade40e970cd6a05 to your computer and use it in GitHub Desktop.
Jakarta controller annotations to Spring annotations
| Jakarta RESTful Web Services | Spring REST | What it does |
|------------------------------|------------------------------|-------------------------------------------------------------------|
| @PathParam | @PathVariable | Binds the method parameter to a path segment. |
| @QueryParam | @RequestParam | Binds the method parameter to the value of an HTTP query parameter.|
| @MatrixParam | @MatrixVariable | Binds the method parameter to the value of an HTTP matrix parameter.|
| @HeaderParam | @RequestHeader | Binds the method parameter to an HTTP header value. |
| @CookieParam | @CookieValue | Binds the method parameter to a cookie value. |
| @FormParam | @RequestParam | Binds the method parameter to a form value. |
| @DefaultValue | @Value | Specifies a default value for the above bindings when the key isn't found.|
| @Context | @Autowired/@Inject | Injects an instance of a resource class, provider, or context object.|
| @Auth(io.dropwizard.auth) | @AuthenticationPrincipal | Binds the method parameter to the currently authenticated user. |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment