• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

How to send multiple pages to same browser  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP that has a form that submits to a servlet to read a file and then return the value of the file in a bean back to the JSP. I want to be able to send "update" pages to the browser so the client knows the progress of the read. Is there any way I can do a sendRedirect() to the page with a value in the bean telling how much has been read and then keep sending updates every few seconds until the file is read? I know some people do this to show the status of a site search but it looks to me like they send the page with an instant refresh back to the servlet. This won't work for me since the servlet is in the middle of reading a file on another server so I don't want the servlet thread to end until the entire file is read. I have tried coding multiple sendRedirects in the read code but the only thing the browser displays is the last value before the servlet returns. If anybody has any ideas I would appreciate it.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you cannot do this with a jsp architecture. But you can if you use a servlet that creates your html.
Use the out command on the servlet and you can send HTML to
the browser.
example:
out.print("<HTML>");out.print("<BODY>");
out.print("<H1> processing started </H1>");
out.flush();
// do some processing
out.print("<H1> processing ended</H1>");
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!