Class PrettyPrintFilter

  • All Implemented Interfaces:
    javax.ws.rs.container.ContainerResponseFilter

    @Provider
    public class PrettyPrintFilter
    extends Object
    implements javax.ws.rs.container.ContainerResponseFilter
    Adds the ability to optionally output pretty printed responses. Requests containing a 'pretty' parameter in the query string will have formatted responses (if a response body is sent). Example: http://hostname/api/version?pretty
    Since:
    1.0.0
    Author:
    Steve Springett
    • Constructor Detail

      • PrettyPrintFilter

        public PrettyPrintFilter()
    • Method Detail

      • filter

        public void filter​(javax.ws.rs.container.ContainerRequestContext reqCtx,
                           javax.ws.rs.container.ContainerResponseContext respCtx)
                    throws IOException
        Specified by:
        filter in interface javax.ws.rs.container.ContainerResponseFilter
        Throws:
        IOException