amit kumar goyal wrote:
The button submits the request to a servlet which generates the XML. I have set the content type as application/xml and content disposition as attachment for the response headers. But when I open the file from the dialog box it opens the file in the same browser window.
This is the expected behavior from any browser, I already suggest one alternative to this. This is a browser behavior and you can't change it.
amit kumar goyal wrote:
I cannot set the target=_blank because it is not a link but its a button to generate the xml.
I want to open it in a pop up.
One solution, "submit" the action/path from JavaScript on "onclick()" event. Submit it by opening a pop window with the specified FORM action as a URL parameter in popup window. I never tried this but give it a try, also, If you modified your servlet to generate XML and return it as a
string rather than stream, you won't asked for save/open message box
, XML directly get displayed in popup window.
HTH