PrintWriter to a BufferedReader(? i'm assuming thats what ur using) works for you so you should probably stick to that. I dont know why ur using ObjectInputStream/ObjectOutputStream with an XML String. I've had problems with ObjectReaders before too but thats usually cause I timed out when waiting for something to read. You can get around this by using the available() function and checking to make sure something is available to read before actually reading it. Or you can just set SO_TIMEOUT on ur socket to last forever :) Another option, albeit a very high tech lvl one, is to use to XML capabilities of JMS. If your writing sometype of Applet/Servlet chat program using XML for the text, JMS is a great alternative to using regular socket input/output. -Tim
-----Original Message----- From: Godbey, David [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 15, 2001 11:06 AM To: [EMAIL PROTECTED] Subject: Re: Stream XML from servlet to applet There is no PrintReader class. ObjectReaders and ObjectWriters are so convenient. But perhaps they are unsuitable for this task. I'm kind of hoping to avoid spending a lot of time experimenting with different configurations. I've spent a few minutes in the archive as well, with no obvious solution. Thanks anyway for your help, Dave -----Original Message----- From: Gardner Monte [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 15, 2001 10:58 AM To: [EMAIL PROTECTED] Subject: Re: Stream XML from servlet to applet Well, I don't know anything about XML, but it seems if you have a really long string, and the printWriter works ok, then you should just use a printwriter to write each character on the server-side, then use a printReader on the client side to read each character. That's the kind of thing printWriters were designed for. Maybe I've misunderstood your question though. --Monte Glenn Gardner On Thu, 15 Nov 2001, Godbey, David wrote: > What is best way to do this? > > On servlet side, I create an ObjectOutputStream and put the XML string on it > (Oracle query generates XML through OracleXMLQuery class). > > On applet side, I create an ObjectInputStream, readObject with casting to > String. This works fine until the XML string reaches a certain size, then > the applet breaks, throwing a java.io.EOFException. > > Why does it break? If I use PrintWriter and stream the data straight to my > browser, it works fine, so no problem on the Oracle query side. > > What is better way to stream XML between applet and servlet? > > Thanks, > Dave > > ___________________________________________________________________________ > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > > ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
