This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

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:
 
permaculture is largely about replacing oil with people. And one tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!