Skip to content

Instantly share code, notes, and snippets.

Created November 8, 2011 23:22
Show Gist options
  • Save anonymous/1349662 to your computer and use it in GitHub Desktop.
Save anonymous/1349662 to your computer and use it in GitHub Desktop.
Sample Jersey service class
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