here is my Documentservlet
1)getDocument();
the getDocument() will start multiple threads like getNextandPreviousContents(), getKeywordNavigation(), validateLinksInText(), etc
2)waitForAllThreads() here is where my process just stops and waits and the screen stays blank
3) add document to user browsing history
4) some other tasks that really depend on document to load completely
5) then only show jsp / forward to Text.jsp
what i changed now in DocumentServlet is
1)getDocument()
2) if(
doc is not yet loaded)
forwardTo loadingServlet.java (see below)
3) add document to user browsing history
4) some other tasks that really depend on document to load completely
5) then only show jsp / forward to Text.jsp
loading.jsp
will just refresh(META TAG) every 3 secs calling loadingservlet.java and displays loading image
loadingservlet will just check
if document loading done go to DocumentServlet(this servlet will call getDocument() but will not start threads again, just gets document)
else go back to loading.jsp.
question was "is there any way that i can replace the refresh(in loading.jsp every 3 secs which is i know very annoying) to use ajax?