I have a JSP page that needs to accept some info into a form, having said form submit to the same page with an extra "Thanks for __" div that is placed only after the form submit (using a parameter check).
However, I also need to serve up a file on the server for download, but I can't mess with the header's content-disposition to serve the file since the whole jsp page still needs to display. How can I offer this file without making the form submit to a different page? What javascript trick could I use to open a new window that would do this? Javascript would be okay, but nothing that a popup blocker would trump..
I cannot use an a href to send the file--it must be done automatically.
Also, if the file (which is a pdf) is opened in the new window, that's fine too.