Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Auto refresh of pdf mimetype is not loading in HTMLPane

    Broadsoft has developed beowser based clinet with smartGWT technology. It has used HTMLPane component to display the various type of reports like html, pdf ad xls. The reports are loaded with smartGWT RPC get call and displyed in HTMLPane. The get request is fired with HTMLPane itself by using HTMLPane.setContentsURL(). We are generating the reports in to two ways, one is on demand like request is generating by pressing button while other one is scheduing based with timer. First one is working fine while scheduling one is not working if the report type is pdf means the putput widget is not refreshed with the returned data.

    #2
    Were you planning to post more information? (this is obviously not enough).

    Comment


      #3
      We are firing a request as mentioned above with HTMLPane.setContentsURL(), which is hitting the doget of servlet. In the server side we are generating the report and set the byte array content in the response with content type as "application/pdf;charset=ISO-8859-1".

      is = new ByteArrayInputStream(prwiResponse.getRawContentAsByte());
      OutputStream outputStreamClientResponse = null;
      outputStreamClientResponse = response.getOutputStream();
      int intNextByte;
      while ((intNextByte = is.read()) != -1) {
      outputStreamClientResponse.write(intNextByte);
      }

      On first call the report is displayed properly in HTMLPane but in the client side we have real time timer which executes with defined interval of time and made the same request to the servlet. I debugged the code and found that the report is generating and response is populated successfully on the server side but the data is not refreshed on the HTMLPane. To refresh the result I first clear the HTMLPane with HTMPLPane.clear then fire the HTMLPane.setContentsURL().

      Comment


        #4
        All you need to do is setContentsURL(). If you see that that does not cause an HTTP request from the browser at all, this indicates that last time you delivered the report it had HTTP headers that indicated it was cacheable. You can either correct those headers to prevent caching, or just add an arbitrary parameter on the URL that you pass to setContentsURL() as a means of defeating caching.

        Comment

        Working...
        X