redirecting once jsp buffer has been flushed

Posted on 2006-06-06
Last Modified: 2012-05-05
I need to display an animated image to the client whilst some server side processing is carried out. In my code I flush the buffer, perform the server-side code and then want to redirect/forward to another jsp.

How can I do this as If I do a sendRedirect will get an illegalstateexception

Thanks In Advance
Question by:inzaghi

    Author Comment

    come on experts!
    LVL 92

    Accepted Solution

    you cannot do a redirect after some response  has been sent
    LVL 30

    Assisted Solution

    You can only send the response to a request once. If you want asychronous processing in a web-app, use AJAX.

    Author Comment

    To do the redirect I can use window.location. This is working fine.

    But when I flush the browser the html is not being flushed to the client at the point it is done, instead it is done at the end of the processing. Any ideas?
    LVL 14

    Assisted Solution

    I've seen you are seriously trying to implement a progress indicator for your JSP page
    you can get the idea used in this ASP tip
    LVL 30

    Expert Comment

    >> To do the redirect I can use window.location.

    That would run at the client-side, not the server-side.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
    The viewer will learn how to implement Singleton Design Pattern in Java.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now