JAX-RS @Context Options

Here's a good Stackoverflow thread on the types of objects that can be injected in JAX-RS with @Context. Good advice on checking the provider docs (RESTEasy vs Jersey, for instance.) Here's a partial listing, depending on your environment and provider.

javax.ws.rs.core.Application
javax.ws.rs.core.HttpHeaders
javax.ws.rs.core.Request
javax.ws.rs.core.SecurityContext
javax.ws.rs.core.UriInfo
javax.ws.rs.core.Configuration
javax.ws.rs.container.ResourceContext
javax.ws.rs.ext.Providers
javax.servlet.HttpServletRequest
javax.servlet.HttpServletResponse
javax.servlet.ServletConfig
javax.servlet.ServletContext

More Like This Post