You need to set the HTTP header
*addHeader("Content-Disposition","attachment; filename=some-file-name.json"*
);--Sri On 8 April 2010 23:36, Sherry <[email protected]> wrote: > Hi, > I would like to have my application return a JSON object for > download. > > I'm trying to simulate the behavior that happens when I access the > page: "http://search.twitter.com/trends/current.json?exclude=hashtags" > in which the Chrome browser automatically downloads a file > current.json . I've tried to print the JSON string into the output or > through a JSP but it doesn't work (I need to return this JSON file > into an XMLHttpRequest object). > > I've copied the current.json file I downloaded from the twitter link > above into my WAR folder, but when I access it through Chrome it just > opens its contents in the browser, and I would like to be able to > download it, as in the twitter link. > Can anyone direct me how to force this download to happen? > Thank you > Sherry. > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-web-toolkit%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
