Forum
Topic RSS
04:10
16/06/2010
OfflineHi, all I'm trying to convert the example.php to java. I'm just trying to make and easy test without connecting my servlet to any database so im just sending the xml as text but it isnt working. I've

try many ways to send the xml file as text but I could get this to work. My code is:
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
out.print("<?xml version='1.0' encoding='utf-8'?>\n"
+ "<rows>\n"
+ "<page>1</page>\n"
+ "<total>1</total>\n"
+ "<records>1</records>\n"
+ "<row id='1'>\n"
+ "<cell>1</cell>\n"
+ "<cell>Mario</cell>\n"
+ "<cell>29</cell>\n"
+ "</row>\n"
+ "</rows>");
} finally {
out.close();
}
}
What do im doing wrong? Any advice is welcome. Thanks in advance.
Most Users Ever Online: 994
Currently Online:
30 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66
Log In
Home