Created
January 20, 2016 08:40
-
-
Save abhirockzz/9bdb1bfceb71973c2d14 to your computer and use it in GitHub Desktop.
Basic JAX-RS injection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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