• 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

communication between server and open JSP page

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am uploading files to the server and storing them into the database. The user does this by going to the upload.JSP. As each file that is uploaded is processed I would like to show the client (upload.jsp) the name of the file that has been processed. This way they will not sit there waitng and maybe thinking nothing is happening. How can I update the client page(upload.jsp) without the user having to do anything?
Is this possible?
Thank you
david
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use javascript to open a small window which will reflect teh status as uploading till the file actually goes in there
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
David,
I think this depends on whether you are wanting to upload more than one file per page. So that the jsp has to change its state multiple times to display a message on each message as it comes to it. That makes things difficulat and I'm not to sure what you could do short of somehow poling your server for an update on the work thats being done. You might also consider making a small application or applet that can handle this sort of thing better.
The reason why its tricky is because of the nature of web apps. Because its based on client/server or request/response, there isn't any easy way to have the server contact an open jsp page (hence why i suggested poling the server for updates)
I don't know about the previous posters idea - he could very well have just what you need, but would it not be simpler to just say to the user that this might take a few minutes and not to try and refresh the screen?
Alternatively, and this is what i would probably do is, warn the user that the operation might take a few minutes and at say after 30 seconds, contact the server for an update. The idea is to not keep pestering the server to much but also to let the user know whats going on.
Of course, if the upload completes inbetween a 30 second "refreshpoint" then the javabean or whatever thats actually doing the processing should just forward the user to a success page rather than hanging about for the next refresh.
I'd either do it that way or make a simple applet
Good luck
Simon
 
reply
    Bookmark Topic Watch Topic
  • New Topic