• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jsp:forward

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic