Best way to write text content from servlet

Discussion in 'Java' started by Bruce Lee, Oct 7, 2005.

  1. Bruce Lee

    Bruce Lee Guest

    Just curious to what is the best performing way of writing dynamic content
    out. Is it :
    -build content in a string buffer
    -out.println(stringbuffer.toString())

    If there's a task underway that may take a few seconds is it a good idea to
    print out something straight away - like the top of the page 1st - then
    write out the body which is in the StringBuffer?
     
    Bruce Lee, Oct 7, 2005
    #1
    1. Advertising

  2. Bruce Lee wrote:
    > Just curious to what is the best performing way of writing dynamic content
    > out. Is it :
    > -build content in a string buffer
    > -out.println(stringbuffer.toString())
    >
    > If there's a task underway that may take a few seconds is it a good idea to
    > print out something straight away - like the top of the page 1st - then
    > write out the body which is in the StringBuffer?
    >
    >


    In my opinion buffered looks better, but it all depends. If it's only
    the last 10% that is delayed/slow, the user might get the wrong
    impression that the page is fully loaded when it's only 90% loaded.

    --
    jon martin solaas
     
    Jon Martin Solaas, Oct 9, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. circuit_breaker
    Replies:
    2
    Views:
    2,016
    Jack Jia
    Apr 4, 2004
  2. hazz
    Replies:
    6
    Views:
    49,631
    SkyUCHC
    Jun 9, 2010
  3. anita
    Replies:
    7
    Views:
    2,566
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Sep 1, 2007
  4. sravanreddy001
    Replies:
    17
    Views:
    581
    sravanreddy001
    Sep 21, 2011
  5. Andy Fish
    Replies:
    3
    Views:
    174
    Andy Fish
    Aug 19, 2003
Loading...

Share This Page