I have seen a lot of Jersey tutorials that starts with something like
@ApplicationPath("services")
public class JerseyApplication extends ResourceConfig {
public JerseyApplication() {
packages("com.abc.jersey.services");
}
}
without explaining what exactly the ResourceConfig class is. So where can I find its documentation, usage, etc.? Googling for "jersey resourceconfig" does not yield any official doc.
Some of my questions about this class and its usage are:
- What things can I do inside the subclass of
ResourceConfig? - Do I need to register the subclass of
ResourceConfigsomewhere so that it can be found or is it automatically detected by Jersey? - If the subclass is automatically detected what happens if I have multiple subclasses of
ResourceConfig? - Is the purpose of
ResourceConfigthe same as theweb.xmlfile? If so what happens if I have both in my project? Does one of them take precedence over the other?