Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:forward

 
Rex Rock
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi people,
I have a form, where I collect details from user, if everything is fine, take him to a new page, thank him for submitting details.
I would like to take the user to another page,after displaying the thank you page for 2 seconds (say).
I tried <jsp:forward page="http://localhost:8080/newpage.jsp" />.
I get the following error,
java.io.IOException: Error: Attempt to clear a buffer that's already been flushed
Please shed some light here..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64186
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot forward once some output has been sent as part of the response. The best way to achieve what you are attempting is to either use the HTML meta tag to cause a redirect after your 2 seconds are up:
<META HTTP-EQUIV="Refresh" CONTENT="2; URL=whatever.jsp">
or to use a Javascript timeout to cause the redirect of you need more programmatic control.
hth,
bear
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic