Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Generated Xml-File: make available for the user

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, i have generate an XML File. At first i have wrote a DOM document. With an other funtion i have transform the DOM document with the class javax.xml.transform:

Now i will that the user can download the generated XML-File from the browser. But i have no idea how i can realize this. Maybe with response.getOutputStream() or something else? Have anyone an idea?
 
Ranch Hand
Posts: 111
Mac Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No idea about XML transformation, but if you want to send any XML file to the browser then you can use response.setContentType("application/xml")

Hope it helps.
 
Markus Jura
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the xml transformation is not so important. i get a file in my struts action. i can output this file (xml-file) as a string, so that the user can copy the content of the xml-file and paste this content to an xml-file at his own operation system. this solution is not best practises :-(

what i must write in the struts action that the user can download this file? for example he click in the browser at a link and can saved the file. i tried this but it doesnt work:
 
It's just like a fortune cookie, but instead of a cookie, it's pie. And we'll call it ... tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic