Bookmark Topic Watch Topic
  • New Topic

XML response from servlet  RSS feed

 
venkat
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi,
i am trying to get a xml response from a servlet.I am getting the xml
as response from servlet along with some junk characters.Kindly tell me
how can i avoid the junk characters as i need to marshall this stream.

response.setContentType("application/x-java-serialized-object");

OutputStream outputStream = response.getOutputStream();
System.out.println(outputStream);
ObjectOutputStream output = new ObjectOutputStream(outputStream);

output.writeObject("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+
"<text timestamp=\"08:45:00.000\">"+
"The deadline of <name>homework 1</name> is"+
"<emph>March 9th 2001</emph>."+
"</text>");
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Report post to moderator
You should try the servlets forum for better results
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
This question has already been posted on three other occasions. This topic is closed.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!