A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Certification
»
Programmer Certification (SCJP/OCPJP)
Author
XML response from servlet
venkat
Greenhorn
Joined: Feb 03, 2007
Posts: 5
posted
Feb 04, 2007 09:03:00
0
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
Joined: Feb 24, 2006
Posts: 6588
1
I like...
posted
Feb 04, 2007 09:53:00
0
You should try the
servlets
forum for better results
SCJP 6 articles
-
SCJP 5/6 mock exams
-
SCJP Mocks
-
SCJP 5 Mock exam (Word document )
-
SCJP 5 Mock exam in Java.Inquisition format
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56191
13
I like...
posted
Feb 04, 2007 12:34:00
0
This question has already been posted on three other occasions. This topic is closed.
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: XML response from servlet
Similar Threads
Customizing Epic Editor
save a xml file using java
junk characters in xml response
why do i get few junk characters in the XML response
response from servlet of xml format
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter