问题
The documentation for the resteasy.use.builtin.providers
configuration switch reads:
Whether or not to register default, built-in @Provider classes.
I have set that to false to use my own (GWT) JSON format, but would like to know what i am missing or if is there anyone i should not exclude.
So, what are the built-in @Provider classes in Resteasy, or how can i find them?
回答1:
I don't know a documentation for that. Best way may be to search in the sources.
If you are only using resteasy-jaxrs you can find these providers in the master-branch:
* org.jboss.resteasy.client.exception.mapper.ApacheHttpClient4ExceptionMapper
* org.jboss.resteasy.core.AcceptHeaderByFileSuffixFilter
* org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPFilter
* org.jboss.resteasy.plugins.interceptors.encoding.AcceptEncodingGZIPInterceptor
* org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor
* org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor
* org.jboss.resteasy.plugins.providers.DataSourceProvider
* org.jboss.resteasy.plugins.providers.DefaultTextPlain
* org.jboss.resteasy.plugins.providers.DocumentProvider
* org.jboss.resteasy.plugins.providers.FileProvider
* org.jboss.resteasy.plugins.providers.FormUrlEncodedProvider
* org.jboss.resteasy.plugins.providers.IIOImageProvider
* org.jboss.resteasy.plugins.providers.InputStreamProvider
* org.jboss.resteasy.plugins.providers.JaxrsFormProvider
* org.jboss.resteasy.plugins.providers.ReaderProvider
* org.jboss.resteasy.plugins.providers.SerializableProvider
* org.jboss.resteasy.plugins.providers.SourceProvider
* org.jboss.resteasy.plugins.providers.StringTextStar
This are the classes annotated with @Provider
. Mostly the same are registered in META-INF/services/ javax.ws.rs.ext.Providers.
But I'm not sure why you want to do disable them. AFAIK if you register a @Provider
which @Produces(MediaType.APPLICATION_JSON)
or @Consumes(MediaType.APPLICATION_JSON)
the default one will be ignored.
来源:https://stackoverflow.com/questions/24345761/what-are-the-built-in-provider-classes-in-resteasy