Skip to content


Sending huge data to client browser

Posted in Internet, J2EE, Java, Technology.

If you want to pass huge data to the client from your servlet, user may need to wait till the ServletOutputStream or JSPWriter flushes the data. This happens generally whenever you have a number of items page and you want to pass it to the client. The better approach is to flush the data partly using flush() method rather than flushing whole data at a time. You can initially flush header, then navigation bar, then body content and finally footer so that the user need not wait for whole data and he sees the header data immediately and so on with navigation bar, body content and footer.

out.write(header);

out.flush(); // flush the header

out.write(navbar);

out.flush(); // flush the navigation bar

// write dynamic data here

out.flush(); // flush the dynamic data

out.write(footer);

out.flush(); // finally flush the footer

Post Footer automatically generated by wp-posturl plugin for wordpress.

Related posts:

  1. Export File name in servlet/jsp
  2. Reading Mails from secure exchange server in Java


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.







Some HTML is OK

or, reply to this post via trackback.