Version 4

    JAX Content Marshaling with Provider Classes

     

    The JAX-RS specification allows you to plug in your own request/response body reader and writers.  To do this, you annotate a class

    with @Provider and specify the @ProduceMime types for a writer and @ConsumeMime types for a reader.  You must also implement

    a MessageBodyReader/Writer interface respectively.  Here is an example.

     

    Registration with Resteasy

    The Resteasy ServletContextLoader will automatically scan your WEB-INF/lib and classes directories for classes annotated with @Provider or you can manually configure them in web.xml.  See Installation/Configuration