What is the advantages of using ResourceConfig over Application(since ResourceConfig extends Application).
using ResourceConfig
@ApplicationPath("/")
public class MyApplication extends ResourceConfig {
public MyApplication() {
super(MultiPartResource.class, MultiPartResource.class, MultiPartFeature.class);
}
}
using Application
public class MyApplication extends Application {
@Override
public Set<Class<?>> getClasses() {
final Set<Class<?>> classes = new HashSet<Class<?>>();
// register resources and features
classes.add(MultiPartFeature.class);
classes.add(MultiPartResource.class);
classes.add(LoggingFilter.class);
return classes;
}
}
In the post Jersey 2 injection source for multipart formdata @Arul Dhesiaseelan answered to add the MultiPartFeature to both to enable that feature on the server side. Could someone explain.