Joined: Mar 15, 2003
I don't know if this is related to what you have in mind, but I make use of a Java applet which calls a servlet to gather data. The applet opens an HttpURLConnection, then reads back the servlet's response by calling getInputStream(). If you do this, there are some tricky issues in Microsoft IE's implementation of URLConnection to watch out for. Also, if you want this servlet to handle cookies, you have to do some extra work.
You might want to consider forwarding the request/response after the initial processing completes rather than sending another response. This would be a much more standard way of handling the situation where you need multiple things done after a single form is submitted. i.e. Form->Servlet 1->processing ->request dispatcher->forward ->Servlet 2->processing ->request dispatcher->forward ->Servlet 3 etc etc This way you only need one request/response pair, you know the order, and you're not tied to any silliness or broken features of a particular browser.
"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.