hello, please help me (SOS) i build the underling servlet and deploy it on jboss / jbossweb-tomcat50.sar but the output was as follow ref>>>[EMAIL PROTECTED] | ref>>>[EMAIL PROTECTED] | ref>>>[#document: null] | doc>>>[root: null]
then i copy the code and execute it in a class in the main(String args[]) the output was ref>>>[EMAIL PROTECTED] | ref>>>[EMAIL PROTECTED] | ref>>>[EMAIL PROTECTED] | doc>>> <root><attribute><name>speed</name><value>2.0 hz</value></attribute><attribute><name>provider</name><value>intel</value></attribute></root> i will loose my mind, what is the problem, how could this happened, there is nothing worng please please please please please please please please please please please please help me | package test; | import java.io.IOException; | import java.io.StringReader; | import javax.xml.parsers.DocumentBuilder; | import javax.xml.parsers.DocumentBuilderFactory; | import javax.xml.parsers.ParserConfigurationException; | import org.w3c.dom.Document; | import org.w3c.dom.Element; | import org.xml.sax.InputSource; | import org.xml.sax.SAXException; | import javax.servlet.http.*; | public class DomServlet extends HttpServlet | { | public void doGet(HttpServletRequest request,HttpServletResponse response) | { | response.setContentType("text/html"); | getXmlData(); | } | public void getXmlData() | { | try | { | DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); | System.out.println("ref>>>"+factory); | DocumentBuilder builder = builder = factory.newDocumentBuilder(); | System.out.println("ref>>>"+builder); | Document doc = builder.parse(new InputSource(new StringReader(getStoredXML()))); | System.out.println("ref>>>"+doc); | Element root =doc.getDocumentElement(); | System.out.println("doc>>>"+root); | } | catch (SAXException e) | { | e.printStackTrace(); | } | catch (IOException e) | { | e.printStackTrace(); | } | catch(ParserConfigurationException ex) | { | ex.printStackTrace(); | } | } | public static String getStoredXML() | { | String declaration = ""; | return "<?xml version=\"1.0\"?>"+ | "<root>"+ | "<attribute>"+ | "<name>speed</name>"+ | "<value>2.0 hz</value>"+ | "</attribute>"+ | "<attribute>"+ | "<name>provider</name>"+ | "<value>intel</value>"+ | "</attribute>"+ | "</root>"; | } | } View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3895532#3895532 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3895532 ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user