Skip to content

Instantly share code, notes, and snippets.

@cowtowncoder
Created February 27, 2009 23:26
Show Gist options
  • Save cowtowncoder/71771 to your computer and use it in GitHub Desktop.
Save cowtowncoder/71771 to your computer and use it in GitHub Desktop.
package test;
import java.util.*;
import javax.ws.rs.core.*;
public final class RestJsonApplication
extends Application
{
public Set<Class<?>> getClasses()
{
// Need to add resource(s); in this case Echo handler
HashSet<Class<?>> resources = new HashSet<Class<?>>();
resources.add(EchoName.class);
return resources;
}
public Set<Object> getSingletons()
{
HashSet<Object> singletons = new HashSet<Object>();
// Need provider for JSON: (aside from standard yucky badgerfish thingy)
singletons.add(new JsonProvider());
return singletons;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment