Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JAXB: Best approach for marshalling to a string

843834Jan 13 2003 — edited Jan 14 2003
Any opinions here for a servlet? I need to generate an xml document, validate it and then post it to a form element. I am using ByteArrayOutputStream and converting it to string, example:

// create a Marshaller and marshal to string
Marshaller m = jc.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
ByteArrayOutputStream os = new ByteArrayOutputStream();
m.marshal(pcd, os);

xmlDoc = os.toString();
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 11 2003
Added on Jan 13 2003
7 comments
439 views