The class that extends Application in REST
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
@ApplicationPath("/rest-prefix")
public class ApplicationConfig extends Application {
public Set<Class<?>> getClasses() {
return new HashSet<Class<?>>(Arrays.asList(SimpleRESTPojo.class, SimpleRESTEJB.class));
}
}
What's its function? Why should I extend this Application class with a class that do nothing?
If I don't, IDE throws a warning on my REST classes, warning about they doesnt implement Jersey or EE services.
Whay should I extend this Application class, and almost all tutorials do it without other explanation.
Thank you.