Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

How does servlet respond during the file upload process ?

 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi All,

I could not frame a reasonable text for the subject of this post, so had to use that subject, as partly the question is related to file uploading.

But the actual question is,

During the file uploads, specially if the file that is being uploaded is really huge, we do get notification something like "File is being processed" or some sort of progress bar, etc etc.

Now how is this particular functionality handled. Is this handled at client side or at server side?

If client side, how would client ever know, if the request is still being processed, as Servlet would not have committed the response back.

If Servlet sends those notifications back to client, that means it has already commited a response and the request/response cycle is over.


This above scenario is possible, if some sort of Asynchronous mechanism is employed, If I'm not wrong. But, is this actually possible in synchronous world? if yes, any pointers.

Thanks
 
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you don't get anything like that.
 
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Submit the file upload to a hidden iframe. That way, the parent page is still active during the upload.
 
Kumar Raja
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Submit the file upload to a hidden iframe. That way, the parent page is still active during the upload.



Hi Bear, would you mind elaborating a bit more on this. I have seen this functionality in one of our internal portals, where some files are uploaded. But the message "File being processed" is something displayed on a another small browser window, which is not the same browser the original request is sent. But again, how is this periodic notification happening in one single request/response cycle.
 
My pie came with a little toothpic holding up this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!