hey, again i don`t know if this is the right forum, but here we go. my goal is to have a servlet that read data from a mysql databank and display it with xml. i have a java application wich transform the mysql data with dom parser and write them to an xslt file. when i run the app from a konsole everything is fine, but i don`t know how to display the data in a browser. any help is welcome thanx bernd
Balaji Loganathan
author and deputy
Bartender
Joined: Jul 13, 2001
Posts: 3150
posted
0
Originally posted by bernd pier: i have a java application wich transform the mysql data with dom parser and write them to an xslt file. thanx bernd
Hi, May I know why its writing to an xslt file instead of xml file. May be you can try this forum http://www.coderanch.com/forums/f-31/XML for questions related xml,xslt etc.,
The default content type for a response coming from an HttpServelet is "text/html". What you'll need to do to display xml in the browser is somethig like the following... ..more code.. response.setContentType("text/xml"); java.io.PrintWriter out = response.getWriter(); out.println(xmlDumpedToAString); Note: The println() takes a String parameter. You'll probably need to have some code to transform your object (...I'm assuming DOM) into a string representation. Hope this helps,
thanx for your help, excuse this late reply, but i`m just having my holiday`s. of course, i want to put the datas into a DOM object and then into a xml file.a tutorial or example to show me how could be helpfull. so long bernd
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.