AW: line feeds in response
Thanks. Alex -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 9. September 2002 23:42 An: Tomcat Users List Betreff: Re: line feeds in response I had a similar problem a couple of days ago. I had to remove the @ page directive at the start of the jsp page for this to work. That is for the 3 junk chars to stop showing up. I didn't have time to figure out why this happens. We were migrating from JRun to Tomcat. From servletx to jsps. I don't know what parser you use. I use xerces to parse the document. And it works fine w/ or w/o the 3 chars. I convert XML to HTML, etc. But if you have a homegrown parser (that uses some publicly available parser underneath), you might need to start looking for the xml start tag (xml version.../). One of our developers who was parsing the xml discovered that the xml he was getting contained those 3 chars. I suppose he was reading char-by-char instead of looking for the starting xml tag. Note, IE doesn't care about the 3 chars. It's displays the xml document w/ or w/o the 3 chars. Hope this helps. RS Alexander Stage [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] 09/09/02 10:43 AMcc: Please respond toSubject: line feeds in response Tomcat Users List Hi all, got the following problem: I'm generating xml with jsps. Before I write out any response, I'm using out.clearBuffer() to clear anything from the output buffer in order not to write out new lines etc. However, this doesn't seem to work. I always get 3 line feeds before the xml starts, which causes most parsers to fail parsing that xml. I was wondering wether this is caused by the dispatcher mechanism I'm using: RequestDispatcher dispatcher = request.getRequestDispatcher(jspUrl); dispatcher.forward(request,response); since the resulting servlet code for the jsp begins output without any line feeds, so this problem can't have it's origin the jsp. The generated source code is: // begin [file=/includeHeader.jsp;from=(0,2);to=(0,15)] out.clearBuffer(); // end // HTML // begin [file=/includeHeader.jsp;from=(0,17);to=(1,0)] out.write(?xml version=\1.0\ encoding=\UTF-8\?\n); I tried to use also the clear() method in the out object, also reset(), resetBuffer() in HttpServletResponse, with the same results. The line feeds are always outputted before the ?xml version=\1.0\ encoding=\UTF-8\?\n String. I'm running jakarta-tomcat-4.0.4-LE-jdk14 on nt 4.0. Any help would be really, really appreciated. Thanks Alex -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
line feeds in response
Hi all, got the following problem: I'm generating xml with jsps. Before I write out any response, I'm using out.clearBuffer() to clear anything from the output buffer in order not to write out new lines etc. However, this doesn't seem to work. I always get 3 line feeds before the xml starts, which causes most parsers to fail parsing that xml. I was wondering wether this is caused by the dispatcher mechanism I'm using: RequestDispatcher dispatcher = request.getRequestDispatcher(jspUrl); dispatcher.forward(request,response); since the resulting servlet code for the jsp begins output without any line feeds, so this problem can't have it's origin the jsp. I'm running jakarta-tomcat-4.0.4-LE-jdk14 on nt 4.0. Any help would be really appreciated. Alex -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: line feeds in response
There are 3 linefeeds in your jsp before the code that generates the xml. Remove them and you should be ok. There has been a discussion on this before on this list. Search the archives :) -Original Message- From: Alexander Stage [mailto:[EMAIL PROTECTED]] Sent: 09 September 2002 12:12 To: Tomcat Users List Subject: line feeds in response Hi all, got the following problem: I'm generating xml with jsps. Before I write out any response, I'm using out.clearBuffer() to clear anything from the output buffer in order not to write out new lines etc. However, this doesn't seem to work. I always get 3 line feeds before the xml starts, which causes most parsers to fail parsing that xml. I was wondering wether this is caused by the dispatcher mechanism I'm using: RequestDispatcher dispatcher = request.getRequestDispatcher(jspUrl); dispatcher.forward(request,response); since the resulting servlet code for the jsp begins output without any line feeds, so this problem can't have it's origin the jsp. I'm running jakarta-tomcat-4.0.4-LE-jdk14 on nt 4.0. Any help would be really appreciated. Alex -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: line feeds in response
use %@. %jsp: / aso. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: line feeds in response
Hi Jon, unfortunally that is not the solution since I'm clearing the buffer just before starting the output by writing out ?xml version=1.0 encoding=UTF-8? and as I wrote, there are no line feeds outputted by the generated servlet source code. I'm also 100 % percent sure that the outputstream is nowhere else used and if I would write out some line feeds, out.clearBuffer() should throw them out. It also looks like out.clearBuffer() has no effect. Alex -Ursprüngliche Nachricht- Von: jon wingfield [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 9. September 2002 13:27 An: Tomcat Users List; [EMAIL PROTECTED] Betreff: RE: line feeds in response There are 3 linefeeds in your jsp before the code that generates the xml. Remove them and you should be ok. There has been a discussion on this before on this list. Search the archives :) -Original Message- From: Alexander Stage [mailto:[EMAIL PROTECTED]] Sent: 09 September 2002 12:12 To: Tomcat Users List Subject: line feeds in response Hi all, got the following problem: I'm generating xml with jsps. Before I write out any response, I'm using out.clearBuffer() to clear anything from the output buffer in order not to write out new lines etc. However, this doesn't seem to work. I always get 3 line feeds before the xml starts, which causes most parsers to fail parsing that xml. I was wondering wether this is caused by the dispatcher mechanism I'm using: RequestDispatcher dispatcher = request.getRequestDispatcher(jspUrl); dispatcher.forward(request,response); since the resulting servlet code for the jsp begins output without any line feeds, so this problem can't have it's origin the jsp. I'm running jakarta-tomcat-4.0.4-LE-jdk14 on nt 4.0. Any help would be really appreciated. Alex -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
line feeds in response
Hi all, got the following problem: I'm generating xml with jsps. Before I write out any response, I'm using out.clearBuffer() to clear anything from the output buffer in order not to write out new lines etc. However, this doesn't seem to work. I always get 3 line feeds before the xml starts, which causes most parsers to fail parsing that xml. I was wondering wether this is caused by the dispatcher mechanism I'm using: RequestDispatcher dispatcher = request.getRequestDispatcher(jspUrl); dispatcher.forward(request,response); since the resulting servlet code for the jsp begins output without any line feeds, so this problem can't have it's origin the jsp. The generated source code is: // begin [file=/includeHeader.jsp;from=(0,2);to=(0,15)] out.clearBuffer(); // end // HTML // begin [file=/includeHeader.jsp;from=(0,17);to=(1,0)] out.write(?xml version=\1.0\ encoding=\UTF-8\?\n); I tried to use also the clear() method in the out object, also reset(), resetBuffer() in HttpServletResponse, with the same results. The line feeds are always outputted before the ?xml version=\1.0\ encoding=\UTF-8\?\n String. I'm running jakarta-tomcat-4.0.4-LE-jdk14 on nt 4.0. Any help would be really, really appreciated. Thanks Alex -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: line feeds in response
I had a similar problem a couple of days ago. I had to remove the @ page directive at the start of the jsp page for this to work. That is for the 3 junk chars to stop showing up. I didn't have time to figure out why this happens. We were migrating from JRun to Tomcat. From servletx to jsps. I don't know what parser you use. I use xerces to parse the document. And it works fine w/ or w/o the 3 chars. I convert XML to HTML, etc. But if you have a homegrown parser (that uses some publicly available parser underneath), you might need to start looking for the xml start tag (xml version.../). One of our developers who was parsing the xml discovered that the xml he was getting contained those 3 chars. I suppose he was reading char-by-char instead of looking for the starting xml tag. Note, IE doesn't care about the 3 chars. It's displays the xml document w/ or w/o the 3 chars. Hope this helps. RS Alexander Stage [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] 09/09/02 10:43 AMcc: Please respond toSubject: line feeds in response Tomcat Users List Hi all, got the following problem: I'm generating xml with jsps. Before I write out any response, I'm using out.clearBuffer() to clear anything from the output buffer in order not to write out new lines etc. However, this doesn't seem to work. I always get 3 line feeds before the xml starts, which causes most parsers to fail parsing that xml. I was wondering wether this is caused by the dispatcher mechanism I'm using: RequestDispatcher dispatcher = request.getRequestDispatcher(jspUrl); dispatcher.forward(request,response); since the resulting servlet code for the jsp begins output without any line feeds, so this problem can't have it's origin the jsp. The generated source code is: // begin [file=/includeHeader.jsp;from=(0,2);to=(0,15)] out.clearBuffer(); // end // HTML // begin [file=/includeHeader.jsp;from=(0,17);to=(1,0)] out.write(?xml version=\1.0\ encoding=\UTF-8\?\n); I tried to use also the clear() method in the out object, also reset(), resetBuffer() in HttpServletResponse, with the same results. The line feeds are always outputted before the ?xml version=\1.0\ encoding=\UTF-8\?\n String. I'm running jakarta-tomcat-4.0.4-LE-jdk14 on nt 4.0. Any help would be really, really appreciated. Thanks Alex -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]