This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

redirect the generated XML file to the browser using Java servelet

 
cake naiyou
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a java program that can create a XML file and save it. Right now, I need to create a Java servelet, which enables the user to view this created XML file when clicking a button on the web. I would like to know how to do it with Java servelet programming.
 
Paul Clapham
Sheriff
Pie
Posts: 20958
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of saving it (which I assume means writing it to a FileOutputStream) just write it to the servlet response's output stream instead.

And of course you can't use the application (with its public static void main(args[]) method) as is, you would have to extract the XML-producing code from it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic