I have a servlet that must call another servlet, read its response and run a database query based on that response. How do I do that? I know of sendRedirect() and RequestDispatcher's methods but they would transfer control to this second servlet which I don't want.
Whenever I want to call another web application from Java I use HTTPUnit. It's marketed as a web application test framework, but it also contains a neat but powerful way to send stuff to remote web apps and read the result in a useful way.