I've built an application that allow users to upload files via http and I've setup a method for them to receive feedback in the browser to monitor the upload progress. The method requires the upload handler servlet to throw the "showprogress.jsp" to the client with the Refresh header set to force a refresh to the servlet every 5 seconds - which in turn checks the progress in the upload thread, updates the appropriate session information, resets the Refresh header, and redirects back to the "showprogress.jsp" page.
I know there must be better ways to monitor the upload progress, but that is an issue for another time/thread. Everything works perfectly, except the refresh. The servlet redirects to the jsp on the first pass and shows the initial information (files, sizes, percentages) correctly, but the page never refreshes to the specified servlet URL. I am providing the fully qualified URL for the refresh (http://server/context/servlet
). In fact, if I manually enter the servlet URL (the same one specified in the refresh header) into the browser while the upload is in progress I get back "showprogress.jsp" with the updated status information on the uploads. While trying to figure out this issue I've found that I cannot get this refresh to work under any circumstances.
This will not cause "page.jsp" to show http://www.google.com
after 3 seconds. Clearly I'm misunderstanding this process at some point and I suspect it has to do with the sendRedirect mucking things up, but I don't know how else to get the servlet to feed the jsp to the browser.
I _could_ have the servlet completely generate/display the html for the "showprogress.jsp" as setting the Refresh header without specifying the URL does seem to work, but 1) that's less convenient for my current application setup and 2) this should really be working and I'd like to figure out what it is that I'm missing.
Any help is greatly appreciated, and thanks in advance! :-)