I write, because I can not solve the following problem. I have a servlet that processes some information. In response I put both text and binary content. How do I get two re
As answered in your previous question, You can send only one HTTP response per HTTP request. This is not a servlet restriction, this is a HTTP restriction. The server is not supposed to send data to the client unaskingly. That would have made the Internet extremely annoying and unusable. As if you're thrown dead with a continuous stream of spam.
To be able to return two responses, the client has to fire two requests itself. If you want to do this automagically on a "single click", then you can (ab)use some shot of JavaScript for this. E.g.
click
This will fire two requests, one to page.jsp
using normal HTML in current window and another one to downloadservlet/file.ext
in new window using JavaScript. This window will however disappear if the response is of Content-Disposition: attachment
as answered in your previous question.
You only need to take into account that this won't work when the client has JavaScript disabled.