This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes save as dialog problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "save as dialog problem" Watch "save as dialog problem" New topic
Author

save as dialog problem

vikas sharmaa
Ranch Hand

Joined: Jun 28, 2007
Posts: 191
i am facing a problem related to save as dialog box.

i've written the below code in the jsp page mentioned in the window.open to open an xml file.

response.setContentType("text/xml;charset=UTF-16");
response.setHeader("Content-Disposition","attachment; filename=\""+Constants.ReportName.CUSTOMER_DRAWING_NUMS+"\"");

before opening the xml file, a save as dialog box is appearing. when i click on the save as dialog box, xml file is getting saved but the window is not getting closed automatically.

so, i changed the code by replacing attachment with inline as follows:

response.setContentType("text/xml;charset=UTF-16");
response.setHeader("Content-Disposition","inline; filename=\""+Constants.ReportName.CUSTOMER_DRAWING_NUMS+"\"");

now, save as dialog box is not coming and the xml page is opening.

Please let me know, how the save-as dialog box should come and on saving the popup should be closed.
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19719
    
  10

Despite the fact that the data you are transferring happens to be XML, this is not a question about XML at all. Let's move it to somewhere better.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63195
    
  69

You can't. The easiest solution is not to use a popup.
[ July 31, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Have you checked out Aspose?
 
subject: save as dialog problem
 
It's not a secret anymore!