How to write Jersey Multipart webapp, Tomcat Server

前端 未结 3 1212
广开言路
广开言路 2020-12-10 08:11

I\'ve been doing a lot of REST tutorials and enjoying them. Recently, I tried writing a jersey multipart webapp with Netbeans but I can\'t seem to because it seems something

3条回答
  •  佛祖请我去吃肉
    2020-12-10 09:01

    Together with jersey-media-multipart dependency, instead of Application (see below) you can configure ResourceConfig:

    @ApplicationPath("/")
    public class AppConfig extends ResourceConfig {
        public AppConfig() {
            packages("packages.to.scan");
            register(MultiPartFeature.class);
        }
    }
    

    or Jersey REST configuration in web.xml:

    
        jersey.config.server.provider.classnames
        org.glassfish.jersey.media.multipart.MultiPartFeature
    
    

提交回复
热议问题