Out.flush() not working

I can't get the out.flush to work. The page is paused until all values are finished then it is displayed. Here is my example code.
<pre>
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class MyTest extends HttpServlet {
     public void init(ServletConfig conf) throws ServletException {
super.init(conf);
public void service(HttpServletRequest req, HttpServletResponse res)
throws IOException {
// res.setContentType("text/html"); //this nor the one below works
res.setContentType("multipart/x-mixed-replace;boundary=\"boundary\"");
PrintWriter out = res.getWriter();
for(int x=0;x<3;x++){            
     out.println("<br>x = "+x);
     out.flush();
          try{
                    Thread.sleep(1000); //in milliseconds - 1000 milliseconds = 1 second
               catch(InterruptedException ie){}
</pre>

You were hoping that the output of the servlet would be sent piece by piece to the client browser as you generated it? That is not how it works. Nothing is sent until you return from the service method. It is possible to do what I think you were hoping, but you have to work with the browser and have it refresh periodically. I have seen examples of that but I am not competent to try to explain it.

Similar Messages

  • Macbook Pro 2011 DVI HDMI out does not work with TV when the power cable is connected

    My Macbook Pro (Early 2011) DVI HDMI out does not work with TV when the power cable is connected. If get the blue screen and then can use the macbook but nothing is displayed on the TV. If i go into display I can see that there are two screens but nothing displayed on the TV. If i take the power cable out at this point the TV shows the second desktop as expected. If i then reconnect the cable, the screen flickers, as though it is being affected by the power cable, and the screen goes blank on the TV. Only if i remove the DVI cable do i get the blue screen again. If i remove the power cable and reconnect it will do it every single time, so i cannot see it being a TV issue or a minor glitch.
    I have had this working previously but at the minute it seems to not be playing ball....any thoughts
    Thanks
    Dan

    BUMP
    Any ideas?

  • Satellite 1800-100: video-out does not work

    He,
    I just installed windows XP on my old Satellite 1800-100, but now my video-out does not work anymore. So I just downloaded the latest driver, but there's no way I can get it installed. According to Windows the new driver isn't newer, so it won't let me update it. And when i try to unistall the display driver, I have to reboot before it takes effect, and wile rebooting it automaticly installs the standard driver again.
    Can anybody help me?
    Greets,
    Daan

    Hi
    Do you mean TV- out port or monitor port? As far as I know this unit is preinstalled with WXP Home and all drivers can be also used for WXP Pro.
    Did you preinstall your own OS (non recovery image)?

  • DVI video out suddenly not working.

    That's basically it. I have a 23-inch Cinema HD Display at home and at the the office. Suddenly the video out is not working with either of them. The displays control panel lists the external display, so the system is detecting the connected display.
    There is nothing wrong with the displays. I connected an old PowerBook and they light up fine. With my MBP, the power light lights, but nothing is displayed on the Screen.

    there's a somewhat similar thread "external monitor stopped working" with no answers
    my 17" Studio display works as 2nd mon on other computers
    my dvi out does work with a vga monitor and adapter, of course :))
    i'm using the dvi to adc adapter -- could this be involved somehow?
    my laptop display goes blue when i plug in the external monitor as it should, but the 2nd monitor never wakes up, turns on, etc.

  • Check out is not working in jdevloper10g (Subverion10.1.3.41.57 )

    Check out is not working in jdevloper10g (Subverion10.1.3.41.57 )

    Check out is not working in jdevloper10g (Subverion10.1.3.41.57 )

  • System.out.println not working in Tomcat-4.1.x

    System.out.println not working in Tomcat-4.1.24. Any settings has to be enabled??? I am using tomcat for Solaris

    I think u can use ServletContext.log() to output info instased.

  • I have Iphone4 and my Iphone wifi button greyed out mean not working, Please suggest what need to do.

    I have Iphone4 and my Iphone wifi button grayed out mean not working, Please suggest what need to do and i am using ios 6.

    Please ask your question

  • Upgraded to iOS5.1 and now video out is not working. How do I fix this?

    After upgrade to iOS 5.1 the video out is not working! Anyone have this problem? Is there a fix for this? 

    OK so I went to the Apple Store and they said my cable was a third party cable. We tried an apple cable and it worked! So Apple changed the pin out configuration on the OS 5.1 upgrade so only Apple cables will work! So I had to shell out another $40.00 to get that cable!

  • Zoom in and out is not working in folders after installing Lion OS

    Zoom in and out is not working in folders after installing Lion OS. Did not understand why?

    Feature has been removed AFAIK. As far as zoom is concerned, the new operating system has been..whatever the opposite of optimized is...pessimized?

  • JSP Flush not working on submit to page

    I have a page that gets called from another with a badic submit button. In the second page I flush the stream and then wait 10 seconds. The problem is that the browser does not show the response until it is done getting the data and then the whole page shows up. What gives? BTW If I hit the refresh button on the page then it works fine.
    Code below:
    <html>
    <head>
         <title>This is the title</title>
    </head>
    <body>
    here it is.
    </body>
    </html>
    <%
    out.flush();
    Thread.sleep(5000);
    %>
    Response after

    The browser doesn't have to synchronize itself with your output, and there's so much buffering between your JSP and the browser that it couldn't even attempt that anyway. Also, it's quite common that the browser won't display the page until it has received it all, especially if there are tables involved, because it doesn't know how to render the first part until it sees what comes later. I can't imagine why you would want to stall the output, the Internet is slow enough as it is.

  • Left Outer Join Not working in BI 7.0 Infoset

    Hi All,
    I am working on BI 7.0. I have to create a report where I have to display the Target values from a target DSO against the transactional data (Operational data).
    I have a DSO where for a “subteam” value target has been set up on different KPIs.
    In the Info Cube, I have transactional data on daily basis per “subteam”. I have to show the actual and target values.
    I have created an Info Set using Target DSO and Daily operational cube, so that I should able to compare the target and actual values of KPIs, for all the “subteam” values (From DSO, irrespective of whether the data is available in cube for those sub team).
    I have used Outer Left Join in the Info set (DSO on left side), but I am unable to see the desired results. It is working just like an inner join.
    Any Idea why the Outer Left Join is not working? The DSO has only one fey field called “subteam” on which I have set outer left join.
    Regards,
    Amit

    Hi,
    did you solve your problem? because I have the same issue right now: the left outer join doesn't seem to do its job.
    Let me know if you have found a solution, it would be appreciated.
    have a nice day,
    Dominic

  • The video out is NOT WORKING under 10.5.2

    *APPLE please read this;*
    The video out on the MacBook Pro is NOT WORKING under 10.5.2, or precisely is working with a possibility of 10%! Monitors doesn't find signal in, or when they find it, the image is unstable with green shadows.
    _I tried 28 external monitor in a store and only ONE was working normally!_ I tried with all the cables combinations (DVI->DVI or DVI->ANALOG, with several different brand cables).
    Before the 10.5 update, I didn't have any problem with external Monitor.
    The point is that I have installed in the same computer (MAC BOOK PRO) also WINDOWS VISTA, and all the monitors that are not working with MAC OS are working perfectly under VISTA system.
    I made a long research online and I found out that thousands of users have the same problem, but no one receive an answer from APPLE from several months!
    This is not the only problem that I have under MAC OS 10.5, but them, are other topics.
    _Please at least resolve this MAJOR problem that I and thousands of other users have with video out._
    Thank you.
    Leonardo Corbucci Zanobi
    F I R S T A K E - STUDIOS
    www.firstake.net

    Video out under 10.5.2 works fine for me and for a colleague of mine with a more recent MacBook Pro. I'd wager it's a problem with your Leopard install, not a universal one.
    Also, FYI, Apple doesn't read these forums; they're just for user-to-user help. If you want to leave MacBook Pro feedback for Apple, do so here:
    http://www.apple.com/feedback/macbookpro.html
    But again, I do not believe yours is a universal issue. We'll be happy to help troubleshoot though. What do you mean the image is "unstable"? Could you take a digital photograph of the external monitor's screen and upload it somewhere?

  • Read Out Loud Not working in Adobe Reader XI

    Read Out Loud is not working.  I have selected the the Microsoft Anna voice in preferences. I have selected the recommended "infer order from doc".  I am at a loss to know why it does not work.  I am using MS Office Professional 2013.  Please help if you can. 

    agille wrote:
    Read Out Loud is not working.  I have selected the the Microsoft Anna voice in preferences. I have selected the recommended "infer order from doc".  I am at a loss to know why it does not work.  I am using MS Office Professional 2013.  Please help if you can.
    Are you sure that the pdf you have isn't a scan? If so, that's just a picture of text so there is nothing to be read.
    agille wrote:
    I am using MS Office Professional 2013. 
    Is this a clue? I'm not sure how this fits in.

  • Subversion Check Out Suddenly Not Working

    The error only occurs for 'http' subversion URLs; 'https' subversion URLs are not impacted.
    This is drying me nuts for last 5 days!!!
    Out of the blue 5 days ago, SVN access from my MacBook Pro failed: I cannot access any SVN (i.e. not in our University or open source projects etc).
    The error obtain when performing 'svn co', or any other svn commands is shown below.
    This is same message is obtained irrespective of the svn repository (i.e. it is something due to my Macbook)
    $svn co http://anonsvn.internet2.edu/svn/i2mi/branches/GROUPER_1_6_BRANCH/
    $svn: OPTIONS of 'http://anonsvn.internet2.edu/svn/i2mi/branches/GROUPER_1_6_BRANCH': Could not read status line: connection was closed by server (http://anonsvn.internet2.edu)

    I'm experiencing the same problem on MBP running 10.7.5. Some other guys are reporting a similar problem at http://superuser.com/questions/472084/svn-error-when-connecting-from-macbook
    The svn+ssh connection and https connections work all ok. My other machine, running the same OS version does not have the problem. 
    An interesting thing is that I tried to run svn on a Ubuntu inside a virtualbox. It is experiencing the same results: svn ls http:// does not work; svn ls https:// works.
    A note at http://stackoverflow.com/questions/12808500/svn-could-not-read-status-line-error -on-checkout suggests that the culprit could be the Cisco VPN client. I've recently upgraded to Cisco AnyConnect 3.1, and at about the same time svn ls http:// stopped working.

  • Make Subclip with In/Out marks not working in FCP6

    I've captured HDV media in FCP6 using Capture Now and the master clips are captured are broken up by scene. When I attempt to make subclips using In/Out marks on the master clips I get a jagged-edge icon subclip that contains the entire master clip. The subclip does not contain any In/Out marks. Is this a bug or am I missing something?

    That means that you need to contact iTunes store support.  They can provide information about why your in-app purchases are not working.

Maybe you are looking for

  • What is new about CRM 7.0 pricing

    Hi Folks, Please help me In knowing what is new about CRM 7.0 Pricing compares to CRM 2007? Edited by: nnrsdn68 on Oct 27, 2011 12:36 PM Moderation: Locked. Rule number one: Try to find the answer first. [See rules of engagement|https://wiki.sdn.sap.

  • How do i find and move all files across multiple disks

    I just purchased a 2010 Mac Pro and wanted to set it up with a clean install of Mavericks.  I installed a new SSD as my boot disk and did a clean install of Mavericks on it.   All good so far. Now from my previous Macs I have several disks (internal

  • Data Mart and Data Extraction from an Infocube

    Can a data mart which is built on one Infocube in BW support delta extraction? We have two separate BW systems and are trying to extract data from one Infocube in one BW (Source) and load it to one Infocube in another BW(Target)? We have built a data

  • Unable to connect to a Wireless Printer (Printer always Offline)

    Hi, please help me. I am desperate now, even though I feel very happy at first when I purchase my macbook air. My computer: 1. 13.3" macbook air with latest OSX Lion installed. 2. 12" Acer notebook with Windows 7 installed. My wireless router: 1. Lin

  • HELP: Problem when programmatically creating a proxy portlet

    All, I am programmatically creating a proxy portlet from a registerd WSRP Producer portlet. The problem is that when I create the proxy portlet, and then add the portlet to the page I don't get any mode icons in the portlet (i.e. maximize/minimize ic