Created
November 8, 2011 23:22
-
-
Save anonymous/1349662 to your computer and use it in GitHub Desktop.
Sample Jersey service class
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
package path.where.your.service.classes.are; | |
@Path("/my/something") | |
@Produces({"application/json"}) | |
public class SomethingService extends AuthenticatedService | |
{ | |
private static Logger logger = LoggerFactory.getLogger( SomethingService.class ); | |
public SomethingService( @Context HttpServletRequest request ) | |
{ | |
super( request ); | |
} | |
@POST | |
@Path("/create/something") | |
public Response createSomethingFromCompound( String json ) | |
{ | |
// do something with the request body | |
return Response.ok().build(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment