Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Best way to write text content from servlet

Reply
Thread Tools

Best way to write text content from servlet

 
 
Bruce Lee
Guest
Posts: n/a
 
      10-07-2005
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?


 
Reply With Quote
 
 
 
 
Jon Martin Solaas
Guest
Posts: n/a
 
      10-09-2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to write the vector content to a file. sravanreddy001 C++ 17 09-21-2011 12:50 AM
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz ASP .Net 6 06-09-2010 01:54 PM
Why no thread.sleep in servlet and a light way to poll from a servlet anita Java 7 09-01-2007 09:22 PM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM
best way to post data from a javascript to a servlet Andy Fish Javascript 3 08-19-2003 08:55 AM



Advertisments