Topic
  • 1 reply
  • Latest Post - ‏2012-10-24T23:33:57Z by SystemAdmin
SystemAdmin
SystemAdmin
37422 Posts

Pinned topic ajax responses

‏2012-10-23T23:00:51Z |
Hi, I have got WAS 8.0 installed and using Websphere Portal on my own pc without any Web server upfront for purposes of development.
When I make an ajax call I can receive the request and process it and then return an ajax response. However, if the response is large instead of
seeing JSON in clear english it seems to be compressed or encoded - However, if the response is small I can see it clearly in firebug.
There is some setting i need to configure ? I tried setting com.ibm.websphere.webservices.http.responseContentEncoding
to gzip without any luck.
Updated on 2012-10-24T23:33:57Z at 2012-10-24T23:33:57Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    37422 Posts

    Re: ajax responses

    ‏2012-10-24T23:33:57Z  
    Currently my portlets are returning "json" which maps to:
    <bean id="json" class="org.springframework.web.servlet.view.json.MappingJacksonJsonView">
    MappingJacksonJsonView returns the response, but the response header : Content-Encoding:gzip
    does not exist and it seems to present garbaged response.
    response headers:
    Cache-Control:max-age=0
    Content-Language:en-US
    Content-Length:1820
    Content-Type:application/json
    Date:Wed, 24 Oct 2012 22:36:42 GMT
    Server:WebSphere Application Server/8.0
    X-Powered-By:Servlet/3.0

    I changed the portlet to just write out the response:
    PrintWriter out = pResponse.getWriter();
    pResponse.setContentType("application/json");
    out.print(FAKERESPONSE); // a large string of 10000 chars
    out.flush();
    return null;
    In the browser I see the response header Content-Encoding:gzip is appearing,
    and in the response I can clearly see the response.
    response headers:
    Cache-Control:max-age=0
    Content-Encoding:gzip
    Content-Language:en-US
    Content-Length:1217
    Content-Type:application/json
    Date:Wed, 24 Oct 2012 22:36:53 GMT
    Server:WebSphere Application Server/8.0
    X-Powered-By:Servlet/3.0

    Does anyone know the difference between the two that is causing the gzip appearing in one and not the other ?