[jQuery] Need to make page do 2 things at the same time. Is this possible?

[jQuery] Need to make page do 2 things at the same time. Is this possible?


All,
I have a jsp that needs to do 2 things:
1. the jsp page needs to invoke a servlet (I'm currently doing this
when the user submits a form in the jsp page). The servlet will check
some info and if the right info is there it will direct the invocation
(request) to a media file. The media file will play.
2. the jsp page needs to redirect itself to a different page *after*
it has confirmed that the media file (in #1 above) has started
playing.
I've figured out how to do either #1 *or* #2 (easy) - but doing both
is hard - and I don't even know if it is possible.
I've tried making the jsp call the servlet, wait 10 seconds and then
redirect that page. During that 10 seconds the servlet might decide
it can play the media file and return it and it will start playing (in
a player) then, 10 seconds later, the jsp will redirect itself. Easy
enough - except the page isn't really "waiting" for a response from
the servlet - it is only hoping the servlet "finished" within 10
seconds.
I've also tried using Ajax to "capture" the response from the
servlet. My hope is that I'd be able to get the URL to the media file
out of the XmlHttpRequest object - but I can't. So I can redirect
itself to another page *after* the servlet finished - but it can't
actually play the media file (no player automatically starts up).
Is what I'm wanting to do even possible?
Thanks!
-john