In my app a user requests Engineering Drawing data. A servlet presents a page with the data including a http link to the drawing file so it can be viewed. I use a servlet to display the drawing to the user. The problem is the user may need more than one drawing at a time open. The only way I have found to get this to work is using the following line of code in the servlet:
You can't. If you dispose the response as an attachment, it directs the browser to download the file; hence the Save As dialog. You cannot write files to the user's system directly without them knowing about it. Imagine the security implications if this were possible!
If you want multiple windows to open, you'll need to open them using client-side code, and submit a request for each drawing in each window.