Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Basic JAX-RS injection
@Path("test")
public class JAXRSInjectionTestResource{
@HeaderParam("token")
//Assume that Token has a public ctor with a String param
private Token token;
@GET
@Path("{id}")
@Produces("application/json")
public CustDetails fetch(@PathParam("id") String custID){
//this method will be invoked by a HTTP GET on http://host:port/context-root/test/42
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment