Wrox Home  
Search P2P Archive for: Go

  Return to Index  

servlets thread: RE: OutPut on browser???


Message #1 by Chanoch Wiggers <ChanochW@w...> on Thu, 16 Aug 2001 12:51:12 +0100
is it possible that XMLWriter needs to know where you want the output? it
looks like there is not relationship between your out variable and the
XMLWriter which suggests to me that without more information the XMLWriter
is choosing System.out as its default output stream. Try passing in your
variable out to the constrcutor for XMLWriter ( I am not sure about this
because I dont know how XMLWriter works but you should be able to get docs
to help you with this.) Possible changes to your code would be:


			PrintWriter out = res.getWriter();	  
			try{
	          		XMLWriter w = new XMLWriter(out);
// make change here ---------------------------------^
			        w.startDocument();
 			        w.dataElement("greeting", "Hello, world!");
 			        w.endDocument();
			    }
			catch(Exception e){}
 
		    }
             }

Thanks in advance
Bikash

  Return to Index