Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

convert beans to XML and retun out of a function

 
Sven
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
i whould like to convert my java bean into xml and then send it over a network to decode it en build my beans back

i know you can use XMLEncoder e = new XMLEncoder(
new BufferedOutputStream(
new FileOutputStream("Test.xml")))
but i wonderif there is a way to not save it as a file first and return a stream or a string in my function

like this :
public String getPaginaToXML() {
return "converted bean as xml"
}

thanx
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Welcome to Javaranch,
May i request you to change your display name as indicated in http://www.javaranch.com/name.jsp
Thank you.
[ September 28, 2004: Message edited by: Balaji Loganathan ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic