Add context fields and parameters to obtain information about requests.
Configure the JAX-RS application.
Parent
Use JAX-RS context objects to obtain more information about requests
We can obtain information about requests using HttpHeaders objects, UriInfo objects, Request objects, or SecurityContext objects.
- Obtaining HTTP headers using HttpHeaders objects
- Obtain information about URLs using UriInfo objects
- Evaluate request preconditions using Request objects
- Determine security information using SecurityContext objects
What to do next
Assemble JAX-RS web applications.
Subtopics
- Obtaining HTTP headers using HttpHeaders objects
Using Java API for RESTful Web Services (JAX-RS), we can use the HttpHeaders object to access request headers.
- Obtaining information about URIs using UriInfo objects
Using Java API for RESTful Web Services (JAX-RS), we can use the UriInfo object to access request headers. The UriInfo object provides methods to enable you to find or build URI information of a request.
- Evaluating request preconditions using Request objects
Using Java API for RESTful Web Services (JAX-RS), we can use the Request object to access request headers. The Request object provides methods for evaluating preconditions and for selecting the optimal response variant based on the request headers.
- Determine security information using SecurityContext objects
Using Java API for RESTful Web Services (JAX-RS), we can use the SecurityContext object to access security information from the request context.
Related tasks
Obtaining HTTP headers using HttpHeaders objects Obtaining information about URIs using UriInfo objects Evaluating request preconditions using Request objects Determine security information using SecurityContext objects