2

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.

Joseph
  • 149
  • 1
  • 2
  • 9
  • Possible duplicate see: https://stackoverflow.com/questions/42077690/what-is-that-application-class-lifecycle-of-a-rest-service – fejko_drakula Jul 25 '17 at 11:43

0 Answers0