Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


redirecting once jsp buffer has been flushed

Posted on 2006-06-06
Medium Priority
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

ID: 16843732
come on experts!
LVL 92

Accepted Solution

objects earned 672 total points
ID: 16847493
you cannot do a redirect after some response  has been sent
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 664 total points
ID: 16849687
You can only send the response to a request once. If you want asychronous processing in a web-app, use AJAX.
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 16850769
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

hoomanv earned 664 total points
ID: 16852238
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

by:Mayank S
ID: 16852277
>> To do the redirect I can use window.location.

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

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

569 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