Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9164145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:36:41+00:00 2026-06-17T14:36:41+00:00

I have a REST method where I want to output gziped content. I have

  • 0

I have a REST method where I want to output gziped content. I have added

 <init-param>
         <param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
         <param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
     </init-param>

To the servlet in web.xml

I can see that the code goes thru the GZIPContentEncodingFilter class by debugging but output does not get the .gzip prefix and content is not compressed, instead it is normal json. I am using Jersey 1.14.

Method looks like:

@GET
    @Path("/fundlight")
    @Produces(MediaType.APPLICATION_JSON)
    public Response getFundLightList() {

        StopWatch watch = new StopWatch();
        watch.start();

        Collection<Object> objectResults = null;

        objectResults = getCacheMap("FundLight").values();
        List<FundLight> fundLightList = new ArrayList(objectResults);

        watch.stop();

        GenericEntity<List<FundLight>> entity = new GenericEntity<List<FundLight>>(fundLightList) {
        };


         ResponseBuilder builder = Response.ok(entity);
         return builder.build();

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:36:42+00:00Added an answer on June 17, 2026 at 2:36 pm

    I think it depends on the client request header parameters.

    If the request contains an Accept-Encoding header containing “gzip” then the response entity (if any) is compressed using gzip and a Content-Encoding header of “gzip” is added to the response.

    See:
    http://jersey.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I want to use the Twitter Users Lookup (REST API) method, this: http://apiwiki.twitter.com/w/page/24142947/Twitter-REST-API-Method:-users-lookup
I have to map a REST Webservice URL like http://server:8080/application/service/customer/v1 to createCustomer method in
I have a REST service that returns a JSON like this: [{@id:123,name:Name}] and I'm
I have a REST service for which I have a WADL file. I want
I am trying to make a WCF REST method entirely asynchronous (I don't want
I have a REST method at http://api.mysite/RestMethod?uid=1 that accepts Credentials object in the body
I have a REST service that gets a GET request, and I want it
I have a REST Server in Java JAX-RS and an HTML page. I want
I have a REST WCF service that has a method that gets a parameter
I have the following method: public void DoSomething() { Console.WriteLine(); } I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.